-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Add more solutions to Project Euler problems #2695
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
Comments
UPDATE: Please read the Project Euler Solution Guidelines for Coding Style before opening a pull request.UPDATE: Only submit solution to problems which doesn't exists in this repository.As of now, we are only accepting PRs with one algorithm in it as it is easier to review one file at a time. NOTE:
One step at a time FAQ:
|
Where can I get the problems from? |
https://projecteuler.net/ |
Thanks it helped🙂 |
Added problem_38 folder with solution file sol.py. TheAlgorithms#2695
Added problem_38 in project_euler TheAlgorithms#2695
I would love to join and contribute. Project Euler was always fun to me back in college :) |
Hi, |
@berry-thawson Please refer to problem_54#L367-L369 import os # with other imports
...
def solution():
script_dir = os.path.abspath(os.path.dirname(__file__))
<file_name_without_extension> = os.path.join(script_dir, "<file_name>")
with open(<file_name_without_extension> , "r") as file_hand:
# ... your code ...
I hope this clears your doubt. If you still have any problem, don't hesitate to ask. |
Thanks @dhruvmanila |
Hi, can we add solution to any problem? |
* Added solution for Project Euler problem 38. Fixes: TheAlgorithms#2695 * Update docstring and 0-padding in directory name. Reference: TheAlgorithms#3256 * Renamed is_9_palindromic to is_9_pandigital. * Changed just-in-case return value for solution() to None. * Moved exmplanation to module-level docstring and deleted unnecessary import
* Added solution for Project Euler problem 87. Fixes: TheAlgorithms#2695 * Update docstring and 0-padding in directory name. Reference: TheAlgorithms#3256
* add solution to Project Euler problem 206 * Add solution to Project Euler problem 205 * updating DIRECTORY.md * updating DIRECTORY.md * Revert "Add solution to Project Euler problem 205" This reverts commit 64e3d36. * Revert "add solution to Project Euler problem 206" This reverts commit 53568cf. * add solution for project euler problem 207 * updating DIRECTORY.md * add type hint for output of helper function * Correct default parameter value in solution * use descriptive variable names and remove problem solution from doctest Fixes: TheAlgorithms#2695 Co-authored-by: nico <[email protected]> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Readd Project Euler 206 solution for issue TheAlgorithms#2695, dupe of pull request TheAlgorithms#3042 * Add PE 206 to directory * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Name: Prime square remainders Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn−1)^n + (pn+1)^n is divided by pn^2. For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25. The least value of n for which the remainder first exceeds 10^9 is 7037. Find the least value of n for which the remainder first exceeds 10^10. Reference: https://projecteuler.net/problem=123 reference: TheAlgorithms#2695 Co-authored-by: Ravi Kandasamy Sundaram <[email protected]>
* Add solution for Project Euler 70, Fixes: TheAlgorithms#2695 * Remove parameter from solution() * Add tests for all functions, add fstring and positional arg for solution() * Rename directory to 070 * Move up explanation to module code block * Move solution() below helper functions, rename variables * Remove whitespace from defining min_numerator * Add whitespace * Improve type hints with typing.List Co-authored-by: Dhruv Manilawala <[email protected]>
* Added solution for Project Euler problem 38. Fixes: TheAlgorithms#2695 * Update docstring and 0-padding in directory name. Reference: TheAlgorithms#3256 * Renamed is_9_palindromic to is_9_pandigital. * Changed just-in-case return value for solution() to None. * Moved exmplanation to module-level docstring and deleted unnecessary import
* Added solution for Project Euler problem 87. Fixes: TheAlgorithms#2695 * Update docstring and 0-padding in directory name. Reference: TheAlgorithms#3256
* add solution to Project Euler problem 206 * Add solution to Project Euler problem 205 * updating DIRECTORY.md * updating DIRECTORY.md * Revert "Add solution to Project Euler problem 205" This reverts commit 64e3d36. * Revert "add solution to Project Euler problem 206" This reverts commit 53568cf. * add solution for project euler problem 207 * updating DIRECTORY.md * add type hint for output of helper function * Correct default parameter value in solution * use descriptive variable names and remove problem solution from doctest Fixes: TheAlgorithms#2695 Co-authored-by: nico <[email protected]> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Readd Project Euler 206 solution for issue TheAlgorithms#2695, dupe of pull request TheAlgorithms#3042 * Add PE 206 to directory * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Name: Prime square remainders Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn−1)^n + (pn+1)^n is divided by pn^2. For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25. The least value of n for which the remainder first exceeds 10^9 is 7037. Find the least value of n for which the remainder first exceeds 10^10. Reference: https://projecteuler.net/problem=123 reference: TheAlgorithms#2695 Co-authored-by: Ravi Kandasamy Sundaram <[email protected]>
* Add solution for Project Euler 70, Fixes: TheAlgorithms#2695 * Remove parameter from solution() * Add tests for all functions, add fstring and positional arg for solution() * Rename directory to 070 * Move up explanation to module code block * Move solution() below helper functions, rename variables * Remove whitespace from defining min_numerator * Add whitespace * Improve type hints with typing.List Co-authored-by: Dhruv Manilawala <[email protected]>
Name: Digit power sum Problem Statement: The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a number with this property is 614656 = 284. We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30 Reference: https://projecteuler.net/problem=119 reference: TheAlgorithms#2695 Co-authored-by: Ravi Kandasamy Sundaram <[email protected]>
* Added solution for Project Euler problem 113. TheAlgorithms#2695 * Updated formatting and doctests. Reference: TheAlgorithms#3256
* Added solution for Project Euler problemm problem 173. TheAlgorithms#2695 * Added docstring * Update formatting, doctest and annotations. Reference: TheAlgorithms#3256
* Added solution for Project Euler problem 74. Fixes: TheAlgorithms#2695 * Added doctest for solution() in project_euler/problem_74/sol1.py * Update docstrings and 0-padding of directory name. Reference: TheAlgorithms#3256
* Added solution for Project Euler problem 91. Reference: TheAlgorithms#2695 * Added doctest for solution() in project_euler/problem_91/sol1.py * Update docstring and 0-padding in directory name. Reference: TheAlgorithms#3256 * Update sol1.py Co-authored-by: Dhruv <[email protected]>
* Added solution for Project Euler problem 38. Fixes: TheAlgorithms#2695 * Update docstring and 0-padding in directory name. Reference: TheAlgorithms#3256 * Renamed is_9_palindromic to is_9_pandigital. * Changed just-in-case return value for solution() to None. * Moved exmplanation to module-level docstring and deleted unnecessary import
* Added solution for Project Euler problem 87. Fixes: TheAlgorithms#2695 * Update docstring and 0-padding in directory name. Reference: TheAlgorithms#3256
* add solution to Project Euler problem 206 * Add solution to Project Euler problem 205 * updating DIRECTORY.md * updating DIRECTORY.md * Revert "Add solution to Project Euler problem 205" This reverts commit 64e3d36. * Revert "add solution to Project Euler problem 206" This reverts commit 53568cf. * add solution for project euler problem 207 * updating DIRECTORY.md * add type hint for output of helper function * Correct default parameter value in solution * use descriptive variable names and remove problem solution from doctest Fixes: TheAlgorithms#2695 Co-authored-by: nico <[email protected]> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Readd Project Euler 206 solution for issue TheAlgorithms#2695, dupe of pull request TheAlgorithms#3042 * Add PE 206 to directory * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Name: Prime square remainders Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn−1)^n + (pn+1)^n is divided by pn^2. For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25. The least value of n for which the remainder first exceeds 10^9 is 7037. Find the least value of n for which the remainder first exceeds 10^10. Reference: https://projecteuler.net/problem=123 reference: TheAlgorithms#2695 Co-authored-by: Ravi Kandasamy Sundaram <[email protected]>
* Add solution for Project Euler 70, Fixes: TheAlgorithms#2695 * Remove parameter from solution() * Add tests for all functions, add fstring and positional arg for solution() * Rename directory to 070 * Move up explanation to module code block * Move solution() below helper functions, rename variables * Remove whitespace from defining min_numerator * Add whitespace * Improve type hints with typing.List Co-authored-by: Dhruv Manilawala <[email protected]>
* Added solution for Project Euler problem 38. Fixes: TheAlgorithms#2695 * Update docstring and 0-padding in directory name. Reference: TheAlgorithms#3256 * Renamed is_9_palindromic to is_9_pandigital. * Changed just-in-case return value for solution() to None. * Moved exmplanation to module-level docstring and deleted unnecessary import
* Added solution for Project Euler problem 87. Fixes: TheAlgorithms#2695 * Update docstring and 0-padding in directory name. Reference: TheAlgorithms#3256
* add solution to Project Euler problem 206 * Add solution to Project Euler problem 205 * updating DIRECTORY.md * updating DIRECTORY.md * Revert "Add solution to Project Euler problem 205" This reverts commit 64e3d36. * Revert "add solution to Project Euler problem 206" This reverts commit 53568cf. * add solution for project euler problem 207 * updating DIRECTORY.md * add type hint for output of helper function * Correct default parameter value in solution * use descriptive variable names and remove problem solution from doctest Fixes: TheAlgorithms#2695 Co-authored-by: nico <[email protected]> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Readd Project Euler 206 solution for issue TheAlgorithms#2695, dupe of pull request TheAlgorithms#3042 * Add PE 206 to directory * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Name: Prime square remainders Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn−1)^n + (pn+1)^n is divided by pn^2. For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25. The least value of n for which the remainder first exceeds 10^9 is 7037. Find the least value of n for which the remainder first exceeds 10^10. Reference: https://projecteuler.net/problem=123 reference: TheAlgorithms#2695 Co-authored-by: Ravi Kandasamy Sundaram <[email protected]>
* Add solution for Project Euler 70, Fixes: TheAlgorithms#2695 * Remove parameter from solution() * Add tests for all functions, add fstring and positional arg for solution() * Rename directory to 070 * Move up explanation to module code block * Move solution() below helper functions, rename variables * Remove whitespace from defining min_numerator * Add whitespace * Improve type hints with typing.List Co-authored-by: Dhruv Manilawala <[email protected]>
Project Euler has about 700 problems, but the current repository hosts solutions for only about 60-70 problems.
I'm willing to work on the issue and also if someone wants to help they can join in.
We can create guidelines on how many minimum solutions a PR should have to prevent spammy PRs with just one or two easy solutions. (open to discussion)
The text was updated successfully, but these errors were encountered: