Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Consider the number being a string. I successfully tested with rand(10 ** 1000,10 ** 2000);

  • Custom User Avatar

    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.

  • Custom User Avatar

    Yeah so the strings get upto like 10000 which I presume is the problem. The way I see it you have two options:

    1. 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)

    2. 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.

    3. give up (not a real option) 😦

    Good luck 😁

  • Custom User Avatar