Skip to content

Commit e4c4f86

Browse files
committed
modify code
1 parent d3e1f92 commit e4c4f86

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/topinterviewquestions/Problem_0204_CountPrimes.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,12 @@ public static int countPrimes(int n) {
1212
if (f[i]) {
1313
continue;
1414
}
15-
16-
// 1
17-
// int cur = i;
18-
// int j = i;
19-
// int p = cur * j;
20-
// while (p < n) {
21-
// if (!f[p]) {
22-
// --count;
23-
// f[p] = true;
24-
// }
25-
// cur += 2;
26-
// p = j * cur;
27-
// }
28-
// 1
29-
30-
// 2
3115
for (int j = i * i; j < n; j += 2 * i) {
3216
if (!f[j]) {
3317
--count;
3418
f[j] = true;
3519
}
3620
}
37-
// 2
3821
}
3922
return count;
4023
}

0 commit comments

Comments
 (0)