Leetcode 172 Solution
This article provides solution to leetcode question 172 (factorial-trailing-zeroes)
Access this page by simply typing in "lcs 172" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/factorial-trailing-zeroes
Solution
class Solution {
public:
int trailingZeroes(int n) {
int total = 0;
while (n != 0)
{
total += n / 5;
n /= 5;
}
return total;
}
};