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.
Why would you assume that? If test cases were wrong, the kata wouldn't be approved. The problem comes from the fact that:
1: you're mutating the input string (rarely a good idea)
2: the tests do not guard against this. First, your function is run with the mentioned string, which you mutate, and then the reference solution is run with what's left of the string, leading to unexpected results.
#2 is actually an issue, and should be fixed. I already see some issues raised below about it, and I'm amazed that this issue hasn't been fixed for 4 years or something?!
Still, I have to close it as duplicate (for now). Try to avoid mutating input where possible.