You should read the description better, the cause of all this "strangeness" is explained there.
This kata has some... interesting understanding of what "square of size 0" is :(
could have called reserve() on vector due to (s.size()+1 >> 1).
can't figure it out also - is it clever, or misguided.
this substr is nasty for if it extends the range, it won't segfault but returns valid/truncated data.
man people try to write the shortest most compicated answer and people praise it but they completely forget lisibility.
You should read the description better, the cause of all this "strangeness" is explained there.
This kata has some... interesting understanding of what "square of size 0" is :(
You should also read about code formatting: https://github.com/codewars/codewars.com/wiki/Markdown-Formatting#block-code-formatting
This comment is hidden because it contains spoiler information about the solution
time complexity isn't so obvious
could have called reserve() on vector due to (s.size()+1 >> 1).
can't figure it out also - is it clever, or misguided.
this substr is nasty for if it extends the range, it won't segfault but returns valid/truncated data.