We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e50ebb4 commit 6e39cc3Copy full SHA for 6e39cc3
src/year2017/day23.rs
@@ -72,7 +72,7 @@ fn composite(n: u32) -> Option<u32> {
72
if n % 2 == 0 {
73
return Some(n);
74
};
75
- for f in (3..=n.isqrt()).step_by(2) {
+ for f in (3..).step_by(2).take_while(|m| m * m <= n) {
76
if n % f == 0 {
77
78
}
0 commit comments