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.
Ahh, you mean every person swaps with the person who has the same index from the other side of the queue (with respect to the 1's and 3's). that's not really clear at first, I thought we would swap everyone with the last person in the line.
I don't understand why do we swap even after the queue had been sorted, and what is the algorithm that we use to swap after sorted?
Well, I've been able to get the index of the digit we want in the corresponding element, like if (
n
) is 9.then I know that its index is 3 in the 4th element, and the number of digits of the element is 4.
Am I going the right way? (C++)
Yeah, you're correct. After adding new line after each test case, it really isn't.
Didn't he say "All numbers are equal except for one"? then why there are some test cases that has multiple values?