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.
I think your solution is way less efective, and in this top rated solution is problem with creating String s (it's redundant) we should just return new string from substring and that is it. Clear effictient and without redundancy :).
Solution depends on case. Should not pass tests.
you can create stream of Characters initially to avoid additional boxing. (check my iml)
This comment is hidden because it contains spoiler information about the solution
Ha! This is realy clever!
@xehpuk, you are correct, my mistake, thanks!
What concatenation? This solution uses basic arithmetic. Simple and performant.
It's bad practice! Because every use of the substring method creates a new string. Hence we pollute the string pool. See mine....
But the use of concatenation in loops (or recursions) is an awful practice. Should remember during daily work.
This comment is hidden because it contains spoiler information about the solution