Skip to content

Latest commit

 

History

History
14 lines (13 loc) · 188 Bytes

172. Factorial Trailing Zeroes.md

File metadata and controls

14 lines (13 loc) · 188 Bytes
class Solution {
public:
    int trailingZeroes(int n) {
        int ans = 0;
        while (n) {
            n /= 5;
            ans += n;
        }
        return ans;
    }
};