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.
Ta.
Fork here.
Python, JS and Haskell have
permuts(0) -> 1
test.C needs updated example solution.
Approved with
permuts(0)
JS translation
does not yet have
permuts(0)
I still see
unsigned
in the function signature and the description still has "Values up to n = 200 will be tested." ??( Python, possibly C )
Add a test for
permuts(0) -> 1
( because[] -> []
is valid ).Or specify
n > 0
. But that's the chicken way out of course.this is the same in the Python version, because this kata is a puzzle
fixed
C translation doesn't actually calculate the requested Kata outcome, because the result doesn't fit the
unsigned
return type.Either limit the input for the C solution, or use larger return types (or both).
C translation doesn't show expected value, only "Incorrect Result".
Not sure if this is intentional, but usually that's not acceptable.
Very nice.
Another beautiful problem from benjaminzwhite!
although this comment helped me, it still does no fully describe the actual criterion, which is really hard to deduce from the description: if a prime permutation is above
n_max
, it does not count towardsk_perms
and the initial number is still a valid candidate. for example forn_max = 2000, k = 1
,1979
is a valid solution because it has a single prime permutation<= 2000
, that is1997
. This is despite the fact that there are other prime permutations of1979
that are above2000
:7919, 9719, 9791
thank your for the comments. I was so lost looking at people's solutions
Loading more items...