Below is the recursive solution. I share this solution simply because of its concision. It took 260ms, which is not so brilliant but still acceptable.

```
public class Solution {
public int trailingZeroes(int n) {
if (n / 5 == 0) return 0;
return n / 5 + trailingZeroes(n / 5);
}
}
```