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 towards k_perms and the initial number is still a valid candidate. for example for n_max = 2000, k = 1, 1979 is a valid solution because it has a single prime permutation <= 2000, that is 1997. This is despite the fact that there are other prime permutations of 1979 that are above 2000: 7919, 9719, 9791
If not stated, the area by definition is always the positive value, and the sides are undirected, so it's not required to specifically note about absolute area. (Otherwise yeah, the area might be negative in some circumstances, but that's an overkill imho)
Probably that was because of some shenanigans with assertions; rn both 3.10 and 3.11 correctly evaluate either float or int values, so it doesn't really matter to specify that either.
Hope I've answered your suggestions, closing this now
Not really an issue, no performance tag, no explicit mention of large arrays. A performant version may be created but I doubt if it is any different than myjinxin's three sum and four sum kata (potentially others ... ->
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
If not stated, the area by definition is always the positive value, and the sides are undirected, so it's not required to specifically note about absolute area. (Otherwise yeah, the area might be negative in some circumstances, but that's an overkill imho)
Probably that was because of some shenanigans with assertions; rn both 3.10 and 3.11 correctly evaluate either float or int values, so it doesn't really matter to specify that either.
Hope I've answered your suggestions, closing this now
approved!
i substantially improved the RNG in Python
Not really an issue, no performance tag, no explicit mention of large arrays. A performant version may be created but I doubt if it is any different than myjinxin's three sum and four sum kata (potentially others ... ->
One of the best kata I've done!
reminds me the Minion movie
Done
Interesting kata, not that easy.
Great kata of the series to practice with and to learn from, thanks.
More like a math challenge, however nice.
Nice kata.
Loading more items...