You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Think this primality test should be simplified. You may use the following algorithm:
// 2 is a special case of prime, and if n < 2 then skip it. For others see bellow
if n > 2 {
for i := 2; i <= i/2; i++ {
if n % i == 0 {
break
//It's not a prime
}
}
// It's a prime
}
I am referring to the simplification of the following part of the code:
Think this primality test should be simplified. You may use the following algorithm:
I am referring to the simplification of the following part of the code:
learngo/13-loops/exercises/10-crunch-the-primes/solution/main.go
Line 39 in e366d1a
The text was updated successfully, but these errors were encountered: