Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0e9586f

Browse files
authored
feat: update ts solution to lcci problem: No.16.05 (doocs#2611)
1 parent 7a4055a commit 0e9586f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lcci/16.05.Factorial Zeros/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func trailingZeroes(n int) int {
8585
```ts
8686
function trailingZeroes(n: number): number {
8787
let ans = 0;
88-
while (n > 0) {
88+
while (n) {
8989
n = Math.floor(n / 5);
9090
ans += n;
9191
}

lcci/16.05.Factorial Zeros/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func trailingZeroes(n int) int {
9393
```ts
9494
function trailingZeroes(n: number): number {
9595
let ans = 0;
96-
while (n > 0) {
96+
while (n) {
9797
n = Math.floor(n / 5);
9898
ans += n;
9999
}

lcci/16.05.Factorial Zeros/Solution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function trailingZeroes(n: number): number {
22
let ans = 0;
3-
while (n > 0) {
3+
while (n) {
44
n = Math.floor(n / 5);
55
ans += n;
66
}

0 commit comments

Comments
 (0)