Ad
  • Custom User Avatar

    As specified, m can be up to 1e18, which is larger than Number.MAX_SAFE_INT. This is precisely why BigInt is used.

  • Custom User Avatar

    See my reply above. Please create a new fork of your translation with all updates. I will check it and approve it.

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    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?

  • Custom User Avatar

    b may be as high as 10**18 in Big numbers tests. The reference solution should be updated: replace math.Pow with repeated multiplication. You may also increase the number of tests but I don't think it is necessary.

  • Custom User Avatar

    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?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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:

    n = 9010954778750400
    m = 9010954778750410
    Expected
        <[]int | len:1, cap:1>: [9010954778750401]
    to equal
        <[]int | len:1, cap:1>: [9010954778750400]
    
  • Custom User Avatar

    Kata wasn't showing complete actual and expected values because of missing truncateThreshold.

    Please refresh ( save your code! ) and try again.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution