The problem asks to count the number of trailing zeros in n!. This is essentially counting how many multiples of 5 are multiplied in during the computation of n!.
| |
The problem asks for the position of the lowest bit 1 in the binary representation of N!. We can observe that multiplying by odd numbers doesn’t affect the position of 1. Each time we multiply by 2, the entire value shifts left by 1 bit. Therefore, the result depends on the number of times 2 appears as a factor.
| |