/** * @param n * @return number of trailing zeros in the factorial of n */ public static int factTrailingZeroes(int n) { int count = 0; while (n >= 5) { n /= 5; count += n; } return count; }