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.
That is also what irritated me. It would make more sense if you could move if the direction is already correct.
The code would have been so much clear without that case...
Concatentating a string throughout a loop is a bad practice and will result in poor performance.
I do not think this code will work if all the test strings were reversed. I had a similar one but I added x string first instead of y and it did not work.
Thank you for your comment. I will correct my answer.
I just looked over it quickly, but it looks like you are also checking if it is near interesting when it is already past an interesting number.
It should only check if an interesting number is within the next 2 mileage. It is not interesting anymore when it is past it.