feat(euler): Optimize problem 034 with a lower upper bound by ArnabTechiee · Pull Request #13531 · TheAlgorithms/Python · GitHub
Skip to content

feat(euler): Optimize problem 034 with a lower upper bound - #13531

Open
ArnabTechiee wants to merge 2 commits into
TheAlgorithms:masterfrom
ArnabTechiee:feat/optimize-euler-034
Open

ArnabTechiee wants to merge 2 commits into
TheAlgorithms:masterfrom
ArnabTechiee:feat/optimize-euler-034

Conversation

@ArnabTechiee

Copy link
Copy Markdown

Contributes to #8594

Description

This pull request optimizes the solution for Project Euler Problem 34 (problem_034/sol1.py).

The change replaces the previous, larger upper bound calculation with a more efficient, mathematically proven limit of 1,499,999. This significantly reduces the number of iterations required to find the solution, making the code much faster.

This optimization is based on the proof referenced in the original issue.

How I Tested It

The updated solution's correctness has been verified by running the project's validation script:
python scripts/validate_solutions.py 34

@ArnabTechiee

Copy link
Copy Markdown
Author

@mindaugl mindaugl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link does not seem to work, it redirects to unrelated webpage.

@ArnabTechiee

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants