1ms - 1 line - Java Solution


  • 12
    A

    Another way to deal

    public int trailingZeroes(int n) {
        return n>=5 ? n/5 + trailingZeroes(n/5): 0;
    }

Log in to reply
 

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