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.
approved by someone
Java Translation
The thing is, the largest safe number — where the "safe" means "able to represent integers exactly and to correctly compare them", — is
$2^{53}-1$
, while the highest number the values are tested to is MUCH bigger than that number. With it there is zero guarantee the integer will be presented correctly — maybe it would be shown up as1.23456789e308
or something, maybe it will becomeInfinity
.With BigInt, however, you can be sure no matter how large will be the number, it will be correctly represented as is and correctly compared, manipulated and whatsoever — so that's why it's used here.
The more details can be found on the link above the function — you may want to click "Reset" button to get link to BigInt article.
Also yeah, BigInts can't be mixed with other types, so you may want to tweak your solution to resolve that issue on your side
Is there a reason BigInts are used here? I've solved it but this is the only thing stopping the tests passing...
TypeError: Cannot mix BigInt and other types, use explicit conversions
Removed
That's a nice way of saying that it adds negative value to the kata.
Rust: solution setup -> no reason to have the variable mutable
Then I would say it's pointless and not really necessary and does not add much value to the problem.
It's just for that, one more
if
.
.
JS fork resolving my issue below
JS should have the new test framework; more information can be found here and here
UPD: too high
N
for JS, too, for it the values are informative (Infinity
), in contrary to Python.Loading more items...