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 guess because it's more comprehensive and declarative.
Because a String object can't be changed. In this code in the line "s+=string;" a new string is created every iteration.
Guys, one trick) Default constructor StringBuilder() constructs a string builder with no characters in it and an initial capacity of 16 characters. When those 16 characters are filled, sb automatically increases it's size and copies the data into it. So, if possible, it's better to define the expected size of your StringBuilder with this constructor StringBuilder(int capacity). So your code will be more effective)
One must be carefull with this method, because when you pass "int[] array", you pass a reference to the array. So, after the completion of the method the source array is also inverted.
else is not necessary here, i++ is enough)
And what if those three digits \d{3} start with 0, like 023? The number must be not valid in that case.
This comment is hidden because it contains spoiler information about the solution
And what about ArrayIndexOutOfBoundsException?)
But you don't provide a check for not valid input in this code, so that's really not good practice)