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 breaks at the example 10100000000 (timeout)
plus 9 is quite clever
Yeah, I did that! took some time to observe this though after first attempt(using itertools permutations) timed out on larger numbers.
wow, smart
Mine timed out when I tried something similar lol
Try
a += 9
for a constant 9x speedup -- any number is always a multiple of 9 away from other numbers shuffled from the same set of digits.Couple of things to point out:
if w in dic
and it is not indic
.Congratulationso on solving!
Note that your question is not really answerable wihout mentioning in which language you're solving the kata, because test frameworks differ in showing partial results or not. Also, the answer to your question could have been "yes, there is a pathological case for your solution" because we don't know your solution. Help us help you!
This seems like a great solution in terms of performance, but the variable naming and lack of functions leaves it very difficult to read.
I have got my time for the sample tests down to ~1500ms, but I time out on the non-sample tests, apparently without passing a single one. Is 1500ms in the practice run too slow, or could the tests be hitting some pathological case that my code does not handle well? What kind of times are other people getting for the samples?
edit: Turns out I was very close. Just needed a small amount of tweaking and the full test battery solved in ~9s