3 lines c++ solution (4ms)


  • 2
    P
    int trailingZeroes(int n) {
        int num = 0;
        while (n > 4) num += n /= 5;
        return num;
    }

Log in to reply
 

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