Trailing Zeros in Factorial
Given an integer A, return the number of trailing zeroes in A!.
Note: Your solution should be in logarithmic time complexity. **Problem Constraints**
1 <= A <= 10000 **Input Format**
First and only argumment is integer A. **Output Format**
Return an integer, the answer to the problem. **Example Input**
Input 1:
 A = 4Input 2:
 A = 5**Example Output**
Output 1:
 0Output 2:
 1**Example Explanation**
Explanation 1:
 4! = 24Explanation 2:
 5! = 120public class Solution {
    public int trailingZeroes(int A) {
        if (A < 5)
            return 0;
        return (A / 5) + trailingZeroes(A / 5);
    }
}Last updated