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.
Well done kata! And especially the unit tests, that can find out many corner cases. This was the hardest one I have passed so far, although this was not my first 1kyu.
A solution must be really optimized to pass all the checks. However, the time limit of 16000ms is so restrictive that sometimes not exceeding it seems a matter of good luck, which could be frustrating.
At least I hope rows are numbered top down like in "2D arrays", and not bottom up.
Very nice, challenging kata! To be honest, I started with a general algorithm, configuring it to solve 7x7 puzzles here in this kata, skipping 4x4 and 6x6 katas as those had no Kotlin versions yet. Anyway, this algorithm should also work for them.
Yeah... I know. Just a simple suggestion that it was too easy.
I think this kata is too easy for 4kyu.
It is unclear why one apostrophe "'" or three apostrophes "'''" are not a word if "Apostrophes can appear at the start, middle or end of a word" and a word consists of "letters (A to Z) optionally containing one or more apostrophes". Stating clearly the rule that "a word must contain at least one letter" would improve the description.
It is also unclear from the current description, if a word can contain two adjacent apostrophes.
implied tail recursion recognized by the Kotlin compiler...?
The "return" keyword could have been factored out in Kotlin to before the whole if-then statement.
Hmmm... During the pre-submit tests (the hidden ones), I received StackOverflow exception for recursive solutoin like this. So I had to change my solution to a non-recursive one (in a loop).
The "weight" of this soure code is really impressive. :)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Kotlin has a nice syntax with "when" keyword. Otherwise, the solution is perfect.
This comment is hidden because it contains spoiler information about the solution
In fact, toCharArray() was not necessary, as map { } implicitly converts a String into a char sequence (list of chars).
Loading more items...