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.
Very nice kata, adds the desired layer of novelty over parts 1 and 2.
My submitted solution is not showing up on the "Solutions" tab, is this a bug in the CW system?
Are the numbers of marbles in
urn1
andurn2
reported before or after the draw?👍
For example, I just got a random test with
age = 57
andIHR = 32
.Here
(220 - 57) * 20% = 32.6
, which is greater thanIHR
, and the reference solution assumes that the0.6
portion contributes to the distance as in the safe zone.The core problem is that in your random
IHR
generation, the lower boundMHR * 20%
is by default rounded downwards. If you round it upwards (viaMath.ceil
), it should resolve the issue.This comment is hidden because it contains spoiler information about the solution
Tests involve cases where IHR < MHR * 20%. The reference solution assumes that heart rates below MHR * 20% are effectively in the "soft" zone. In other words, the reference solution assumes that the soft zone begins at zero heart rate.
It's fixed.
The reference solution seems to be broken for single-color urns:
urn: {"DeepSkyBlue":47}, color:"DeepSkyBlue", draws:35, target:20: expected [ 1n, 1n ] to deeply equal [ 40320320n, 17043n ]
Re-raising the issue of testing with approximate equality. I thought I had resolved the issue, but I only did so for the python version.
Resolved.
Resolved.
Resolved.
Resolved.
Duplicate of https://www.codewars.com/kata/5d653190d94b3b0021ec8f2b/
I approved it, thanks for the translation. The initial solution seems broken, though.
Loading more items...