Skip to content

Commit 3d36f40

Browse files
authored
added FactorialTrailingZeroes.java
1 parent b0fe5d6 commit 3d36f40

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

FactorialTrailingZeroes.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution {
2+
3+
4+
public int trailingZeroes(int n) {
5+
6+
int ans=0;
7+
while(n>=5)
8+
{
9+
n/=5;
10+
ans+=n;
11+
}
12+
13+
return ans;
14+
}
15+
}
16+
Stay Hungry! Stay f00lish : )

0 commit comments

Comments
 (0)