File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 8
8
* that number. A factorial of a number N is a product of all numbers in the
9
9
range [1, N].
10
10
11
- * We know that we get a trailing zero only if the number is multiple of 10 or
12
- has a factor pair (2,5). In all factorials of
13
- * any number greater than 5, we have many 2s more than 5s in the prime
14
- factorization of that number. Dividing a
15
- * number by powers of 5 will give us the count of 5s in its factors. So, the
16
- number of 5s will tell us the number of trailing zeroes.
11
+ * We know that we get a trailing zero only if the number is multiple of 10 or has a factor pair (2,5). In all factorials of
12
+ * any number greater than 5, we have many 2s more than 5s in the prime factorization of that number. Dividing a
13
+ * number by powers of 5 will give us the count of 5s in its factors. So, the number of 5s will tell us the number of trailing zeroes.
17
14
* @author [Swastika Gupta](https://github.com/Swastyy)
18
15
*/
19
16
You can’t perform that action at this time.
0 commit comments