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 job addressing the issues raised. I'll mark it as resolved.
A hint: Count groups of 0s as well as groups of 1s in order to determine the time unit.
Please tell me which function fails in the test fixture. Otherwise I have to add a print statement to every function.
Most of the problems have already been mentioned: unclear problem description, including unclear input and fringe cases
What I like to do to troubleshoot in this case is print out the input. Try putting "print sequence" (without quotes) at the beginning of your function. If you're still unsure what the problem is, just reply back to me.
If you haven't solved it yet and still want to:
The test case you are having problems with is probably "YA".
I'm guessing your check for vowels does not include uppercase vowels, and so your program just adds an "ay" to the end, thinking there are no vowels.
At the bottom of the test cases, the error message is slightly misspelled:
'Last line should not by aligned'
should be
'Last line should not be aligned'
It wasn't clear whether the shift does or does not increment for non-alphabetic characters and whether the shift resets after each partition. Still an interesting kata!
Your solution returns true for strings when whitespace characters are at the beginning of the string. This is because to_i ignores whitespace when converting to an integer.
For example:
Also, consider using regular expressions. They are a powerful way of parsing strings. In ruby, the shorthand syntax for it is:
see for more detail: http://www.tutorialspoint.com/ruby/ruby_regular_expressions.htm
There already exists published kata with a similar premise in multiple languages, including python.
Also, translated into Java.
There is currently a very similar kata already published under the name "Alphabetic Anagrams" at 3 kyu, for JS, Ruby, Python, Haskell, and Java.
http://www.codewars.com/kata/53e57dada0cb0400ba000688
Loading more items...