-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Fixes: #3163 - Add new solution for problem 234 #3177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9a40fa1
to
8f9d8ea
Compare
8657f0e
to
53ff5d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you for doing this.
is_prime[2] = True | ||
|
||
for i in range(3, int(n ** 0.5 + 1), 2): | ||
index = i * 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In L39 index = i*i
is one optimization here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are most likely right:
- The sieves of Eratosthenes is not my algorithm;
- Optimizing the sieves of Eratosthenes is out of the scope of my PR;
- The Pull Request is already merged.
…rithms#3177) * Fixes: TheAlgorithms#3163 - Add new solution for problem 234 * Apply review suggestions
…rithms#3177) * Fixes: TheAlgorithms#3163 - Add new solution for problem 234 * Apply review suggestions
Describe your change:
Fixes the Project Euler problem 234 by implementing a new working solution that doesn't use any
input()
calls.This PR closes #3163
Checklist:
Fixes: #{$ISSUE_NO}
.