Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Use spoiler flag next time please.
This comment is hidden because it contains spoiler information about the solution
First argument is the pattern we want to find in the string. The pattern can be a string or Regex. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
Second argument is the replacement. It can be a string or a function. If the string is emtpty, we essentially just remove the pattern.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
What does .replace() do?
same solution)
It's regular expressions, they are not supposed to be readable. It's a great tool that you shouldn't avoid just because it doesn't look pretty.
Inefficient, but super clever!
Good grief. Mine is awfully clumsy by comparison... Very nice.
Hello!
By details of this kata we must sum up the CUBES of digits.
I think you need to fix it here "sum += Character.getNumericValue(num);"
However, it is great solution
This comment is hidden because it contains spoiler information about the solution
I dont understand this solution. Can you explain it to me sir? I would like to learn that
I really like this solution. My one thought is if there are potentially a lot of duplicates, would it make sense to check if
words[n]
exists before setting callingnum2word
again?While it's true that this could be approximately twice as fast, the complexity is still the same (constant factors are ignored).
yeah, great solution.
Well thought regex. Simply loved it!
Loading more items...