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.
Thansk for agreeing that I'm correct! I thought I was going mad. I'm not sure (I'm in training and have a lot to still learn about Ruby). However, I dind't modify any of the inputs for the random tests.
I am attempting this kata in Ruby and passed all the test cases. However, in the random tests, if the input array has 3 + 0s in it I am failing.
When I check the expected compared to my solution, the expected seems to have always deleted the 3rd & 4th 0 of the input array, but surely it should only be deleting the 4th as that's the second 0 in the pair. Surely only every other occourance should be deleted? I can see people have passed the test on Ruby so am I just missing something here? Some examples below:
Examples:
[5, 4, 3, 7, 4, 3, 2, 9, 2, 9, 7, 1, 2, 8, 0, 0, 3, 2, 7, 4, 5, 4, 9, 0, 4, 0, 5, 2, 5, 5, 4, 0, 2, 3, 5, 4, 6, 2, 5, 4, 9] input
[5, 4, 3, 7, 4, 3, 2, 9, 2, 9, 7, 1, 2, 8, 0, 3, 2, 7, 4, 5, 4, 9, 4, 5, 2, 5, 5, 4, 0, 2, 3, 5, 4, 6, 2, 5, 4, 9] expected
[5, 4, 3, 7, 4, 3, 2, 9, 2, 9, 7, 1, 2, 8, 0, 3, 2, 7, 4, 5, 4, 9, 0, 4, 5, 2, 5, 5, 4, 0, 2, 3, 5, 4, 6, 2, 5, 4, 9] my result
[6, 3, 9, 2, 9, 0, 7, 7, 5, 4, 9, 1, 7, 6, 4, 5, 0, 6, 0, 9, 6, 6, 3, 9, 0, 2, 4, 5, 7, 3, 8, 1, 2, 9, 4, 7, 4, 0, 0, 6, 5, 4, 4, 4, 4, 2, 7, 8, 6, 1] input
[6, 3, 9, 2, 9, 0, 7, 7, 5, 4, 9, 1, 7, 6, 4, 5, 6, 9, 6, 6, 3, 9, 2, 4, 5, 7, 3, 8, 1, 2, 9, 4, 7, 4, 0, 6, 5, 4, 4, 4, 4, 2, 7, 8, 6, 1] expected
[6, 3, 9, 2, 9, 0, 7, 7, 5, 4, 9, 1, 7, 6, 4, 5, 6, 0, 9, 6, 6, 3, 9, 2, 4, 5, 7, 3, 8, 1, 2, 9, 4, 7, 4, 0, 6, 5, 4, 4, 4, 4, 2, 7, 8, 6, 1] my result
[1, 4, 7, 5, 6, 0, 8, 1, 0, 6, 6, 5, 2, 2, 6, 2, 7, 4, 7, 0, 2, 3, 8, 4, 0, 9, 8] input
[1, 4, 7, 5, 6, 0, 8, 1, 6, 6, 5, 2, 2, 6, 2, 7, 4, 7, 2, 3, 8, 4, 9, 8] expected
[1, 4, 7, 5, 6, 0, 8, 1, 6, 6, 5, 2, 2, 6, 2, 7, 4, 7, 0, 2, 3, 8, 4, 9, 8] my result
Thanks
I am an idiot who can't read questions properly. Thank you v much for your help, that was a simple fix in the end, and sorry for wasting your time!
This comment is hidden because it contains spoiler information about the solution