Ad
  • Custom User Avatar

    Thanks Voile, will keep that in mind next time :)

  • Custom User Avatar

    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.

  • Custom User Avatar

    Right, but as everyone else has been saying, a string isn't technically iterable either yet that is something we want to evaluate.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.