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.
This isnt the point here, the clever votes was just because it's really a funny way to not resolve the problem but pass all tests. you're just so serious to understand.
exactly!
The kata was made with a standard Connect Four setup in mind, and nobody's going to change the requirements now.
There is a carriage return after some chars, so we have 2 lines.
The empty string is indeed considered as 0 line. I can feel your confusion.
I can see your logic but it wouldn't make sense to dismiss empty lines. Imagine a text with empty lines in the middle, it would be weird to skip them!
I see it as a very specific case: empty string = absolutely nothing. Not even a single char to consume. It would be weird to use a text parser for an empty block of text.
The way i see it:
I suppose the kata wasn't overrly specific about that, but I'm sure you managed to fix it with the test cases.
It reminds me of something somewhat related:
If you look for "" (empty string) in a string [see .indexOf() implementations], at which position do you find it?
At the beginning, the end, between each charcater, none?
Cheers