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.
Great one-liner. This solution has a space complexity of O(n) because an array is allocated. In place sorting solutions can have a space completity of O(1).
That was my first solution, but it does not consider input validation according to description:
"... accepts a string containing up to 26 unique alphabetical characters."
why did you use regxp to evaluate, simple > would be more elegant!
Its grate, but this is not correct solution, instructions where rather clear you shuld accept max 26 caracters. N
"I have developed an elegant solution to this problem."
1 minute later. . .
"Oh, there was already a method for that."
that make sense ;)
I did the same solution, but in addition I've added a regex to evaluate if we are having up to 26 lowercase chars. I think arg validation is important.
This is why Ruby is beautiful.