Dec-21-2017, 03:45 PM
Okay, so there is a trick here. You can't purely brute force this.
The trick is, after a certain point any factorial mod 2**32 is 0.
So if the number is bigger than that you just return 0 without doing any calculation.
Take a shot at figuring out what that number is.
The trick is, after a certain point any factorial mod 2**32 is 0.
So if the number is bigger than that you just return 0 without doing any calculation.
Take a shot at figuring out what that number is.