-
-
Notifications
You must be signed in to change notification settings - Fork 44k
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
Implemented improved algorithm using Numba for Project Euler Problem 73 #11204
Commits on Dec 7, 2023
-
Implemented improved algorithm using Numba for Project Euler Problem 73
Existing file with a Python solution to count fractions between 1/3 and 1/2 for denominators up to 12,000 using nested loops and the math module's gcd function. This approach iterates through all possible fractions and counts those meeting the specified criteria. Added an improved solution utilizing the Numba library for optimized performance. This implementation uses a Numba-optimized function solution decorated with @njit to compile the code to machine code, significantly improving execution speed. The algorithm employs a different approach to count fractions between 1/3 and 1/2. It utilizes a loop with numerator and denominator ranges to calculate the count, avoiding unnecessary iterations by counting the fractions directly meeting the criteria while leveraging Numba's JIT compilation for efficiency. Fixes #8594
Configuration menu - View commit details
-
Copy full SHA for e541045 - Browse repository at this point
Copy the full SHA e541045View commit details -
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Configuration menu - View commit details
-
Copy full SHA for 3f00dbd - Browse repository at this point
Copy the full SHA 3f00dbdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d6ab30 - Browse repository at this point
Copy the full SHA 8d6ab30View commit details -
Configuration menu - View commit details
-
Copy full SHA for d3f96f4 - Browse repository at this point
Copy the full SHA d3f96f4View commit details -
Changed the code to not use Numba, since that created issues during p…
…ytest. This program still performs significantly faster than existing solution. Fixes #8594
Configuration menu - View commit details
-
Copy full SHA for 52acb90 - Browse repository at this point
Copy the full SHA 52acb90View commit details -
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Configuration menu - View commit details
-
Copy full SHA for 1278112 - Browse repository at this point
Copy the full SHA 1278112View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f11b8c - Browse repository at this point
Copy the full SHA 8f11b8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 93dc2c4 - Browse repository at this point
Copy the full SHA 93dc2c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for e965f3b - Browse repository at this point
Copy the full SHA e965f3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a4aca01 - Browse repository at this point
Copy the full SHA a4aca01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d99dab - Browse repository at this point
Copy the full SHA 4d99dabView commit details -
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Configuration menu - View commit details
-
Copy full SHA for 95a7331 - Browse repository at this point
Copy the full SHA 95a7331View commit details