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.
Wasn't counting on newlines being tested.
There's nothing wrong with the test case, apparently your solution failed on
1234\n
and098765\n
. The\n
is not visible in the error message (since it's new-line character). I think that's why you assumed it's1234
and098765
when it's not.Unsolvable due to broken test case.
'1234' and '098765' occure twice once as valid pin and once as invalid pin.
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.