Easy to understand Java Solution-

public class Solution {
public int trailingZeroes(int A) {
if (A < 0)
return -1;
int count = 0;
for (int i = 5; A / i >= 1; i *= 5)
count += A / i;
return count;
}
}


Click here to start solving coding interview questions