Skip to content

[Hacker Rank] Interview Preparation Kit: Dictionaries and Hashmaps: S… #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ The second part of this problem can be solved with the binomial coefficient form

But the entire cost of this formula falls on the "factorial" function.

In javascript, the factorial quickly reaches results that return large numbers,
in scientific notation, losing precision.
This loss of precision can result in an erroneous result
in the final calculation of permutations.
The factorial quickly reaches results that return large numbers,
overflowing the length of primitive number types.

To avoid this problem, it is necessary to introduce large number handling using BigInt.
To avoid this problem in Java, it is necessary to introduce large number handling
using java.math.BigInteger