Skip to content

Commit a458820

Browse files
committed
factorial_trailing_zeroes
1 parent f9609aa commit a458820

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ Golang solution for leetcode. For each problem, there is a simple *_test.go to t
148148
#### [168. Excel Sheet Column Title](https://github.com/hitzzc/go-leetcode/tree/master/excel_sheet_column_title)
149149
#### [169. Majority Element](https://github.com/hitzzc/go-leetcode/tree/master/majority_element)
150150
#### [171. Excel Sheet Column Number](https://github.com/hitzzc/go-leetcode/tree/master/excel_sheet_column_number)
151+
#### [172. Factorial Trailing Zeroes](https://github.com/hitzzc/go-leetcode/tree/master/factorial_trailing_zeroes)
152+
151153

152154

153155

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package factorial_trailing_zeroes
2+
3+
func trailingZeroes(n int) int {
4+
ret := 0
5+
for n > 0 {
6+
ret += n / 5
7+
n /= 5
8+
}
9+
return ret
10+
}

0 commit comments

Comments
 (0)