Easy java solution


  • 0
    Z
    public class Solution {
        public int trailingZeroes(int n) {
            int cnt = 0;
            while (n != 0)
            {
                n /= 5;
                cnt += n;
            }
            return cnt;
        }
    }
    

Log in to reply
 

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