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.
Dont thik its look like "Best practice", first becouse of string concatenation, second is redundant for loop.
The best solution is O(n) (just count the occurence of each digit).
But honestly, it doesn't really matter since you're unlikely to be given a million-digits number.
I doubt it is best solution (see forks).
python sorting is nlogn
Clever using binary shift
This comment is hidden because it contains spoiler information about the solution