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.
This comment is hidden because it contains spoiler information about the solution
There is hardly anything optimised there (if not for what
permutations
might do under the hood instead of a function written to do the same by you) and it is actually rather brute-forceish; try to ask yourself how you would solve it as a human and I am sure you would not compute each single possibility, sort them, etc.Also, please, try to format the code properly when posting it :)
[Incidentally, sorting
str(n)
would probably be much better than sortingresult
, but please do not go that way]Just check how long your solution runs for input like
1987654321
.This comment is hidden because it contains spoiler information about the solution