Ad
  • Custom User Avatar

    It is already in the examples in the description. Marking as resolved.

  • Custom User Avatar

    Fixed. Marking as resolved.

  • Custom User Avatar

    [21, 27] is not a sexy prime pair because neither is prime... 21 is divisible by 3 and 7...27 is divisible by 3, 9, and 7

    [16, 22] is not a sexy prime pair because, again, neither is prime...16 is divisible by 2, 4, and 8...22 is divisible by 2 and 11

    Hence, your function should indeed return false because they are not prime. As the description says: "Sexy primes are pairs of TWO PRIMES that are 6 apart".

  • Custom User Avatar

    Apologies, the individual who translated the Kata into Javascript introduced the problem, and it slipped by when I reviewed it. The issue should now be resolved.

  • Custom User Avatar

    After reviewing the answers I can say, with a high degree of certainty, that sexy_primes(21,27) and sexy_primes(16,22) returns false ie. there is a method in the test casses (which we will call method_x for now) which determines whether or not your answer is correct by doing "Test.assert_equals(sexy_primes(x,y), method_x(x,y))". When testing method_x(21,27) and method_x(16,22), the method returned False for both the Javascript and Python languages.

  • Custom User Avatar

    I reorganized both the python and javascript solutions such that the true_tests and false_tests arrays are combined and shuffled before testing to mitigate hardcoded solutions. This should have fixed the issue.

    Marking as resolved.

  • Custom User Avatar

    Thanks for the help. Hopefully someone who knows it stumbles across the kata.

  • Custom User Avatar

    I added that for the python version of the problem, but I don't know ruby or haskell so I can't add that test case for those languages. Marking Issue as resolved for now because the issue doesn't affect the integrity of the problem.

  • Custom User Avatar

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

  • Custom User Avatar

    Sorry about that, should be fixed now.

  • Custom User Avatar

    Apologies, the randomized testing I implemented accidentally called the wrong function.

    Should be fixed now. Thanks for pointing it out!

    Marking as resolved.

  • Custom User Avatar

    I added quite a few more tests as you guys suggested. (100 more randomly generated pairs w/ randint, ~30 more sexy pairs which are tested in a randomized order)

    Thanks for the encouragement and suggestions guys!

  • Custom User Avatar

    Approved. Thanks for the translation!

  • Custom User Avatar

    Description ending has been changed to "Note: Assume that all values in the list are positive integer values > 0 and each value in the list is unique. Also, you must write your own implementation of factorial ie. you cannot use the built-in math.factorial() method in python."

    Marking as resolved.

  • Custom User Avatar

    All approved.

    Thanks for the translations!

  • Loading more items...