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.
As specified,
m
can be up to1e18
, which is larger thanNumber.MAX_SAFE_INT
. This is precisely whyBigInt
is used.See my reply above. Please create a new fork of your translation with all updates. I will check it and approve it.
Ok. Approved.
This comment is hidden because it contains spoiler information about the solution
Thanks! Now i see a huge red message like this: " expected [ ... ] to equal [ ... ] "
I improved my code, but still cant get a right solution. Now it is "STDERR Max Buffer Size Reached (1.5 MiB)".
All test passed except "Big numbers". Sometimes one or two "Big numbers" tests are green too, but others failed.
Ok I've done that.
I ended up just putting in the larger powers of 10 in the format 100_000_000_000_000. I hope that's OK?
I ran it gain, all fine. Then I published again and got an error about failed tests?
b
may be as high as10**18
in Big numbers tests. The reference solution should be updated: replacemath.Pow
with repeated multiplication. You may also increase the number of tests but I don't think it is necessary.I don't think I use numbers larger than 2**53.
The Python tests I copied used 10**14.
But the tests should probably be more numerous and for bigger numbers. I have no idea how to decide how many or how large to make them. Should I do this via trial and error?
I could change everything to int64s or even math/Big I guess, but is this is what's wanted?
This comment is hidden because it contains spoiler information about the solution
Go random tests expect incorrect results for large numbers. Do not use
math.Pow
in the solution (float64
cannot be used for integers larger than$2^{53}$
).An example:
Kata wasn't showing complete actual and expected values because of missing
truncateThreshold
.Please refresh ( save your code! ) and try again.
This comment is hidden because it contains spoiler information about the solution