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.
Well, generating permutations is not the correct way to go about this task. If the number contains a lot of digits, you will end up generating a huge amount of different permutations, which is what leads to your timeout. Look for a pattern between the input that you're given and the correct return value. There is a method to figuring out the next highest number. Try this kata if you're stuck: Basics 08: Find next higher number with same Bits (1's). It's a very similar premise, but it's made simpler by the fact that you're only dealing with 1's and 0's. If you can spot the pattern there, you may be able to apply that knowledge to this kata.
Interesting task, in python I implemented generator that generates next element of permutation for those numbers. Seems to work fine but test cases are timing out after 3/4 test cases for bigger numbers. Any hints for optimazation?