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.
It is already in the examples in the description. Marking as resolved.
Fixed. Marking as resolved.
[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".
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.
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.
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.
Thanks for the help. Hopefully someone who knows it stumbles across the kata.
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.
This comment is hidden because it contains spoiler information about the solution
Sorry about that, should be fixed now.
Apologies, the randomized testing I implemented accidentally called the wrong function.
Should be fixed now. Thanks for pointing it out!
Marking as resolved.
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!
Approved. Thanks for the translation!
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.
All approved.
Thanks for the translations!
Loading more items...