Ad
  • Default User Avatar

    Hello,
    I am using C++ and I have a failure in the random test for:

    6418546418566418576418586418596418606418616418636418646418656418666418676418686418699889899909919929939949959969979981000100110021003

    Expected: equal to 999
    Actual: -1

    If the missing element is 999 (so 3 digits), then the sequence starts with 641. The second number is 854.
    Since:

    In this Kata, you will be given a string of numbers in sequence and your task will be to return the missing number."

    I think the correct result should indeed be -1! Or I am not understanding the kata correctly?

  • Default User Avatar

    Howdy, I need some help from you guys :)

    So, I am using C++ and I was able to have a solution that passes all the tests (including the timeout ones), but it fails afterwards on random tests.

    Here are 2 examples: 141163297, 415765168. In both cases, my answer is 4 while the random tests expect 3.

    I believe it's some problem in my implementation related to some overflow cases, but it's being hard for me to pinpoint the exact reason...
    In order to debug better, I was wondering is someone has a working solution at hand and they could provide me for the 2 numbers:
    141163297
    415765168

    the 3 squared numbers whose sum adds to them.

    Thanks a lot!