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 will try. Looking at the number we can see the smallest digit is 1 which appears in the number in several places, at positions 6,7 and 10 using 0 based indexing.
We choose the the last occurence of the minimumal digit to find the smallest number, so we can tranformer the number say to an array or string to using the built in
method lastIndexOf()
Shift right (you move every character one position to the right, the rightmost char of the string enters from the left):
It's like this
That's because fianl number,
18786300289
, is smaller than18786302809
. You need to get the smallest number possible, the smallest index is a secondary criterion in case there are multiple ways to get the smallest number.18786300289 < 18786302809
I just did, it's an empty string.
No, it's not, and next time mark your post as having spoiler content.
Check that. Your function returns
true
.Leap years are handled by the Date objects automatically, e.g. you can get the date of 29.02 of 2016.
Make sure the object itself is immutable, not only its properties