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
Consider the number being a string. I successfully tested with rand(10 ** 1000,10 ** 2000);
If by
long
you mean 64 bit, signed integer (you did not mention your language), then 59884848459853 is not too big. It does not throw error in my IDE."Permutations approach" is very appropriate for this kata, just not iterating through all possible permutations.
Yeah so the strings get upto like 10000 which I presume is the problem. The way I see it you have two options:
Try in a different language with less perfomance requirments (python strings only go to like 150 chars - my O(n^8) solution passes in under a seccond)
Try to reduce the complexity of your solution (how many times you have to iterate through the input). You could post your code in a spoiler but I don't like java so can't really help (someone else might though). You need to think about how to reduce the number of times you scan through the input. e.g. looking for all the burgers and then starting over and looking for all the fries etc will probably time-out in java.
give up (not a real option) 😦
Good luck 😁
Which language?