Ad
  • Default User Avatar

    There is no way to increase the 12 second limit. It's a codewars rule that every problem has to complete within that time.

    To get a more efficient algorithm, generalize the process described in the example.

  • Default User Avatar

    PickCormac, please try your solution again. It should be successful.

  • Default User Avatar

    I believe you are correct! The C# (and the Java and Swift translations) are overlooking solutions where the squares of one or more of a,b,c exceed the integer bound.

    For example, for diff = 8696, low = 945745, high = 2531281, the Python solution finds (947864, 51654240, 51662936) as a valid triple. But the C# version does all the calculations in integers, and so overlooks this (and other triples). If the calculations are done using doubles (as your program wisely does), it finds them. Amazingly, all the people who solved the C# version previously overlooked this as well (so I don't feel so bad :-)).

    I believe I have fixed the translations.

    Congratulations on discovering this!

  • Default User Avatar

    what makes you think it's broken?