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.
The top "clever" solutions aren't dynamic. Curious how many would fail if the array width/height was 1000x1000 🤔
To beginners thinking this is a "clever solution" that they can't wrap their minds around... It's basically an array of all the expected test return values. Does nothing to help teach what an actual clever solution looks like, but instead shows what a person can do with too much time on their hands for a level 6 kata, to appear "clever" to people who wouldn't know the difference.
Pretty nice "real world" kata.
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
Why do you consider the second blank line in this to have 2 lines?
"Once upon a time.
"
...yet the empty string represents 0 lines?
I don't see how people have the default
var helloWorld = function(){...}
It was failing for me just because of that.
I feel like if you should change the boilerplate if it's going to prevent a "pass"