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.
Though it's the most "natural" answer, shorter is not always better. Using reduce to separate values and keys in a single run would be more efficient than iterating over hash twice.
See my answer to @arieh.
Description is very vague, but basically author is expecting You to raise an exception if:
a) any char in the string is not a number
b) passed string is empty
First line can be reduced to: str.length / 2, because division by int always returns floored result:
2.0.0-p353 :007 > 6 / 2
=> 3
2.0.0-p353 :008 > 5 / 2
=> 2