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
This comment is hidden because it contains spoiler information about the solution
Python is currently failing with what appears to be an error in the reference solution (see spoiler comment below).
In Python,
import fractions
yieldsfractions == None
. This does not seem to be intentional, so I'm assuming something in the import-prevention stuff is broken.Should be posted under "Issues"
:/
Like @crunker99 said above, it's worth noting that this evaluates the expression for every single day. Fine in this case because they're all very cheap, but something to keep in mind.
This comment is hidden because it contains spoiler information about the solution
@dfhwze I think
k == 0
is reachable iffn == 0
. (Take a look at my solution to the current version.)outcome(0, 8, 0)
is expected to equal0
, not1
, which is confusing since summing up zero 8-sided dice will always result in a sum of zero (by the usual convention that the empty sum is zero). The intended behavior forn == 0
should be clarified in the description.The description needs to clarify what should happen when
s = 0
.In Python specifically,
outcome({s}, {n}, {k})
should beoutcome({n}, {s}, {k})
The Python description code blocks are written in Javascript.
Because of the
sorted
bit,a == c
meansa == b == c
, so the equilateral condition can bea == c
and the isosceles condition can bea == b or b == c
.Since this is the top answer on a high-kyu kata, I'll mention that using this level of precision is pointless (from a programming perspective), because nearly all of it will be lost (double-precision floats only have ~16 decimal digits of accuracy).
Loading more items...