• specifically the reference solution

    it wouldn't be so bad if tests gave false negatives, but they give false positives .. :O

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

  • Houston, we have a problem...

    My solution in Python times out but the same one in JS passes all the tests in 3s.

  • Consider what you want in terms of performance. Then test for correct Big-O time complexity instead of having compliant solutions take 11 seconds. Succeeding should take on the order of 1 second for compliant solutions, while uncompliant solutions should time out consistently.

    Please read the chapter on performance testing in the documentation carefully. Get help if you have problems understanding or implementing performance requirements. Beware of requiring micro-optimisations!

    According to the below issue, Python has this problem; JS has it as well. The example solution takes 6 seconds, both submitted solutions take 11 second. This is indicative of too many not large enough tests, though there is something to be said for not too few tests.

  • Python tests are not well balanced - my solution passes them in 9.5-10 sec but still times out once in 10 or so attempts.

    Also, why on earth does testing take so much time? In general case, a valid solution shouldn't almost time out just to pass the tests, even if there're performance requirements.

  • It looks fixed, thanks.

    If it were me, I wouldn't trust the reference solution and just provide everything with a ( deep! ) copy of the input, but as far as I can tell the reference solution actually does it right.

  • This should be fixed now, can you check?

  • ( JS )

    check is used in the wrong way in the test suite. Also, it has undeclared variables and solver can modify the inputs of the random tests.

  • Now you can get a bonus point if you solve the sequel as well. Thank you for the good idea :)

  • Heartfelt thanks for your help! I found a bug in my code. Thanks for the exceptional kata and the help you offered me. Cheers!

  • I remember there is also a sequel,where the proisoners don't know the initial state of the bulb.

  • Unfortunately, I didn't work on this one locally (Couldn't be bothered to set up the local tests with this one), so I don't have the same collections of attempts.

  • I am curious to see your code when it was not passing to understand why. Would you like to share it? You could help me make this kata better.

  • I am respecting the conditions of the notes section. I can see that the message has changed. My living_room function has logic which depends only on prisoner_number, lightbulb, and previous_visits. I do not have code outside of the living room function, and I haven't introduced any additional data structures. Update: I managed to pass after shuffling around the logic.

  • Loading more items...