Skip to content

nadeemramsing/codewars-best-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

codewars-best-solutions

From which new tricks and lessons can be learnt.

JavaScript

  • Using RegExp's Capturing Groups to manipulate strings
  • Third solution is better / simpler / less bug-prone (according to comments)
  • Groups:
    1. First character of word
    2. Remaining characters of word
  • \b => Word boundary (used to match word; e.g: /\b(\w*)\b/g)
  • \w => Any alphanumeric character including the underscore; equivalent to [A-Za-z0-9_]
  • Link


  • Calling functions that accepts multiple arguments using an Array
  • Link


  • Using RegExp's Capturing Groups to manipulate strings
  • Own solution is pretty interesting and simple as well.
  • String interpolation used to separate last item of array.
  • Link


  • Using Array Destructuring for better readability
  • Avoids annoying array[n]
  • Link

Python

  • Vowel Count
    1. Using Regex
    2. Using List Comprehension: an elegant way to define and create lists based on existing lists
  • Link

  • Lambda function: Small anonymous function


  • Mapping a List
    1. Using List Comprehension
    2. Using map
  • Link


  • Abbreviating a two-word name
    1. Using List Destructuring
    2. Using List Comprehension
  • Link

C#

  • Check if an array contains a value
    1. Using namespace System.Linq
    2. Using namespace System
  • Tips:
    • Classes can be made available using using static directive
      • e.g. using static System.Linq.Enumerable
    • Namespace aliases can be used to avoid name clashes
      • e.g. using Linq=System.Linq
  • Link

About

From which new tricks and lessons can be learnt.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published