Ad
  • Custom User Avatar

    Wasn't counting on newlines being tested.

  • Custom User Avatar

    There's nothing wrong with the test case, apparently your solution failed on 1234\n and 098765\n. The \n is not visible in the error message (since it's new-line character). I think that's why you assumed it's 1234 and 098765 when it's not.

  • Custom User Avatar

    Unsolvable due to broken test case.
    '1234' and '098765' occure twice once as valid pin and once as invalid pin.

  • Custom User Avatar

    This Kata is not very robust. Big values for time would lead to invalid results as Double exceeds Integer by far. Double max comes at 2^52 while Integer can hold up to 2^32 considering the result value is on a fringe case 2^51 we will have to deal with overflow. Long would be the more appropriate output value for Double. Alternative to Long would be Float as an input parameter. Further negative inputs are not considered.

    That beeing said that are edge cases that are highly unlikely.