Ad
  • Custom User Avatar

    Fixed

  • Custom User Avatar

    Well, if it eases your pain, browsing other people's solutions and suggesting a similar tweak to another user, I remembered that instead of checking every odd number, just going for 6k+/-1 is much more efficient and edited my solution accordingly.

    I suppose that after many similar problems (I did a lot with primes) one's mind goes fully autopilot ;)

  • Default User Avatar

    Yeah, it actually is... Funny thing is, I found this same problem somewhere else and I used C and I did what you just said. I didn't give it much thought I suppose :P

  • Custom User Avatar

    Testing up to the square root of num is way more efficient, I presume :)

  • Default User Avatar

    The test cases seem to be wrong. This:
    test.assert_equals(rot13("test","grfg"))
    test.assert_equals(rot13("Test","Grfg"))
    Should look like this:
    test.assert_equals(rot13("test"),"grfg")
    test.assert_equals(rot13("Test"),"Grfg")
    or else the test will always fail. But there's isn't any problem while submitting...