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.
Thanks Voile, will keep that in mind next time :)
I don't think it works that way in ruby; you'd have to coerce it into an array with split("") before iterating....
Just go to issues and scroll and read. I'm pretty sure strings are not iterable in ruby. I'm no python expert so I can't comment, but according to others they seem to agree. Conceptually I don't see how you can iterate a string, that just doesn't make sense. You can coerce it into individual characters, but that's an array where each element is an individual string character.
Right, but as everyone else has been saying, a string isn't technically iterable either yet that is something we want to evaluate.
I think this kata is kind of confusing and there aren't enough test cases. For instance, you want "ABBBCD" to return ["A", "B", "C", "D"] here but what if the input was a pure integer 122234? Is this considered unique in that, that is a unique number different from any other integers, or should it return 1234? or should it return [1, 2, 3, 4]? Doesn't actually address a myriad of other inputs and what is expected of the output.
Not sure why you pasted your solution which is different from the onne that is being commented on, where it[0] is not 1 and is really undefined.
I think the problem is, the test case actually doesn't test for pure integers, and that's why it doesn't catch this.
This solution doesn't work if the input is 123334, but the test case is an integer array [1, 2, 3, 3, 4], where comparison is still valid and the returned array still works.