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()
Respect!
This kata is really useful!
That this experience will come in handy!
Respect for autor!
Yes! I get it... )
sometimes, you just need to relax the brain)
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
This comment is hidden because it contains spoiler information about the solution
Thanks)
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
This comment is hidden because it contains spoiler information about the solution
Add tests with punctuation marks for javaScript!
Several, the so-called smartest solutions)) will not pass them!
thanks)
I just did, it's an empty string.
This comment is hidden because it contains spoiler information about the solution
No, it's not, and next time mark your post as having spoiler content.
Check that. Your function returns
true
.Loading more items...