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.
If the parameter is omitted, the default value should be an empty string. Your code is returning nil because the parameter doesn't exist and you are using str even though it doesn't exist.
It's a suggestion not an issue.
Current Ruby translations has 8 example test cases, which is not that few for a kata.
Try to
puts
the original input and see some example; I fear your code might have some counting problem; on a side note, you would only need to use.to_f
once, if you want a small bit of extra optimization.I think you've made just a little mistake and there's a bug in ruby's example test cases. Just rename the method in this example test case or only use the final tests.