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
Most people will probably start from that approach, including me. That's exactly why the character threshold is set right below its length. If no minor "local" edit will shorten that approach further, you'll need to take a detour.
This comment is hidden because it contains spoiler information about the solution
Approved by me, thanks for translating.
This comment is hidden because it contains spoiler information about the solution
How about this:
Granted, it would essentially be another kata entirely ("Lookup Table For Paperfold Sequence"), but it would solve the precalculation issue.
This comment is hidden because it contains spoiler information about the solution
Good catch. Can you switch it to relative (perhaps with a manual calculation)?
By the way, I tried approving your translation, but Codewars states
Description cannot be approved, recent changes from related record must be merged first.
Oh, I see. At least in python,
assert_approx_equals
checks whether the answer is close with absolute or relative margin. By using a margin1e-4
, I intended that the user's answer should be within0.01%
of the reference answer.I'm not sure how the equivalent Javascript assertion function works.
This was related to the int-vs-float return type issue. The description now makes it crystal clear that a full-precision floating-point answer is expected, and the reference expected results are full-precision floating-point numbers as well.
Thanks for translating. You are right, in the sample tests the expected results should be full-precision floating-point numbers such as
93278.32814049922
, not integers such as93278
. This is how the random tests operate as well.(Because of the type of mathematics involved, there will almost certainly be some discrepancy in the answers. For example, my reference solution to the first example is
93278.32814051147
. This is why I chose the relatively lax0.01%
precision requirement.)The intended solution is to return the result as a floating-point number without any rounding. I have updated the description to make this more clear.
I also updated the sample tests to have non-integer reference answers, in order to not send a wrong signal about the intended return data type.
This comment is hidden because it contains spoiler information about the solution
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?Loading more items...