0ms C logn solution


  • 0
    int trailingZeroes(int n) {
        long power = 5;
        long sum = 0;
        while(power<=n){
            sum +=  n/power ;
            power = (power << 2) + power;
        }
        return sum;
    }

Log in to reply
 

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