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.
The problem is ill-posed: one of the sample tests (in Haskell) say
solve 12 4
shouldBe
[1,2,3,6]But [1,2,4,5] is another solution: 1+2+3+6 == 1+2+4+5 and gcd [1,2,3,6] == gcd [1,2,4,5]. How do you choose?
Also there is no mention in the description that the solution list should be ordered, yet you are requiring it.
Missed the descending order part.
Falsifiable (after 5 tests and 6 shrinks):
expected: Just 1
but got: Just 2
[0,1,0]
This was reported two years ago but it hasn't been fixed. Is there any way to do so without the translator's involvement?
I've solved this in Haskell, but it still shows as a non-completed kata
In the Haskell version, I defined a function named
choose
. It all went OK with the sample tests, but then the final try failed because there is another function namedchoose
in scope for those tests. I fixed it by renaming mine tochoose'
, but that is still quite annoying... Maybe a qualified import could be used to avoid this name clash.13 is not even a Mersenne number (not of the form 2^n - 1), but 2^13 - 1 is indeed a Mersenne prime: see https://oeis.org/A000043
For Haskell, the empty list is only checked in the random tests. I submitted a solution that actually breaks for the empty list, but since it was not checked...