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.
This comment is hidden because it contains spoiler information about the solution
Very effective formulation given the description of input! Thank you!
I was trying to figure out why my solution was timing out in R, and out of curiosity I had the function immediately return a list of FALSE and the input hand (code below). I was surprised to see that the server regularly took about 8500ms to process and return the test results. Is anyone else able to duplicate this? If the code that evaluates this kata is really that inefficient then I don't see how someone could complete it.
play_if_enough <- function(a, b) list(FALSE, a)
They are basically the same. As per the documentation:
Was the timeout limit set at 12 seconds when you wrote this? I feel like I have a decent Sieve algorithm, but it only makes it through one of your five large tests before timing out.
Hello, I am seeing an unexpected result when attempting this kata. One example is the input
a = 260
andb = 260001
. In my opinion the prime factors of 260001 are: 3, 3, 7, and 4127. Since 260 is not evenly divisble by all of these numbers (in fact it is not divisible by any of them), I believe the correct result should beFALSE
. My code returnsFALSE
, but it then fails the test for this input. If the correct answer for this input pair is actuallyTRUE
could someone please explain why; I may be misunderstanding the kata or have the wrong prime factors. If the correct answer isFALSE
, can you confirm if the reference solution is actually returning this result in R? I will also mention that my code passes ~95% of the test cases, but it fails with input shown below, which appears to follow a pattern:a = 360; b = 360001
a = 580; b = 5800001
a = 980; b = 980001
a = 570; b = 57001
a = 110; b = 1100001
a = 30; b = 300001
Thank you for this, much needed!