You need to sign in or sign up before continuing.×
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.
Nice use of partition.
Is there someone I can ask about how this works? It's one of the few katas I've skipped over and want to gain an understanding for it. I can read how the hashes translate over, but I'm unfamiliar with the rest of the code.
When in doubt, there's already a method for it. Nice solve.
w.downcase == w checks the whole word instead of the first letter as the description states. This would return the wrong order if a word contained a capital in the middle such as for camelCase.
\w also includes underscores which means ruby_variables_would_be_considered_one_word. So a_Snake_Case like this would really throw it off.
Cool, I didn't know about partition
How does this even work? In MRI I get an error about @@subclasses not being initialized. For this to work, it should be a class-level instance variable (@subclasses) rather than a class variable.
that's awesome
Like the use of partition, but you are comparing the whole word instead of just the first letter like the specification states.
Wow, my long winded solution is so unnessary! As soon as I saw this it was so obvious!