You need to sign in or sign up before continuing.×
  • Custom User Avatar

    Description should be language-agnostic

  • Custom User Avatar

    JS: Random test rarely generate descriptive numbers.

  • Custom User Avatar

    At least in JS: missing edge case tests to distinguish between sum < num and sum <= num (for instance, 4 and 496).

  • Custom User Avatar

    68 39 1.5375906866527354
    Expected: 'HHS', instead got: 'HSSS'

    30 laps on softs give 46.12772059958206 seconds, that's more than 1 pit stop takes.

  • Custom User Avatar

    The top voted Javascript solution is wrong. It fails this simple test:

    Test.assertEquals(amicableNumbers(8,7), false);
    

    Instead it returns true, as it only tests for amicability in one direction. Although the proper factors of 8 add up to 7 (1 + 2 + 4 = 7), the only proper factor of 7 is (1).

    I marked this as an issue with the kata, since the kata test cases only require that the solution tests for amicability in one direction. What is missing are tests like this:

    // For some n
    Test.assertEquals(amicableNumbers(n,sumOfProperDivisors(n)), false);
    Test.assertEquals(amicableNumbers(sumOfProperDivisors(n),n), false);