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.
If you have two different numbers, both numbers cannot be smallest at the same time.
This problem in description allows ambiguous answers.
If it said that i have to be smaller than j whenever it's possible, then it would be OK.
The difficulty is not the same in all languages...
This is a great Kata.
I took so much time to finish this, trying to avoid nested loops.
But then the top answers are all nested loops! This looks weird.
Do we have any performance metrics to pass too?
Thanks anyway. :)
Look closely, the expected result is indeed smaller.
You must have i and j smallest so with your example the good answer is only
[19, 0, 1]
.It allows more than one answer: e.g. 91 to [19, 0, 1] and [19, 1, 0]. Also there can be more than 1 answer when two same digits are in row. This breaks verification to the point "what author assummed".