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.
I didn't notice the easy solution, which I think was better because it made up do more actual coding.
Hey @MikeJH82 and welcome to Codewars - in general, saying that stuff "works on my machine" is covered in the Troubleshooting page , there are lots of reasons why something might seem to work locally but not on CW; the most common being that you haven't tried all possible test cases on your machine, only "basic" ones.
I copied your code vs the tests and it seems that it is failing on inputs of this kind:
s = "L iMiMiMiMiMi R"
your code produces
result = "L R"
with 2 spaces, while expected answer is"L R"
with only 1 space.Indeed the same thing happens with one of the examples from the description:
"1i2 33 i4i5 i555ii5"
for which your code returns"33 55"
with 2 spaces (and here 2 5's also) rather than"33 5"
.For some reason the code I write to remove additional spaces is working in VSCode but not here.