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.
It's fine, we all experience similar problems when starting out here. I know I struggled myself seeing how empty string could be split into 1-length array, not
[]
, but you'll learn these things with practice :P (oh, and lots of debugging with console logs)By the way, when posting some code snippet you should follow this syntax: https://docs.codewars.com/references/markdown/#code-block
I just checked the sample tests, so I know where it crashes.
"".split(' ')
==['']
(I think), so your loop will never terminate.What you need to do is to use console.log inside the loops, and probably at the start to see which input fails. An example in python is shown here: https://docs.codewars.com/training/troubleshooting/#print-input
Just use some console logs and you'll see the problem quickly. Your code fails for empty string, which is even shown to you in sample tests.
Well, it says it's a question to me :P
You cannot change a tag once the message is posted ;)
The tag issue is for an issue in the kata, not a problem with your code. You can post your code, with a spoiler flag and formatting it properly. See there for more details and help: https://docs.codewars.com/training/troubleshooting/
This comment is hidden because it contains spoiler information about the solution