C++ , 3ms


  • 0
    B

    class Solution {
    public:
    int trailingZeroes(int n) {
    if(n<1)
    return 0;
    int count = 0;
    while(n/5)
    {
    count += n/5;
    n = n/5;
    }
    return count;

    }
    

    };


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.