Skip to content

Fix needed for Project Euler problem 234 sol1.py #3163

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

Closed
dhruvmanila opened this issue Oct 10, 2020 · 2 comments · Fixed by #3177
Closed

Fix needed for Project Euler problem 234 sol1.py #3163

dhruvmanila opened this issue Oct 10, 2020 · 2 comments · Fixed by #3177

Comments

@dhruvmanila
Copy link
Member

dhruvmanila commented Oct 10, 2020

Problem:

According to the problem description, the input value for the function solution() should be 999966663333. Now, if we follow the control flow of the problem we see that there's going to be a loop that will have 999966663333 many iterations and for each iteration this line asks the user for input. As mentioned in CONTRIBUTING.md, we cannot ask for input and this solution will be asking for the input for 999966663333 times.

for x in range(n):  # n = 999966663333 according to the problem description
    l = [i for i in input().split()]  # noqa: E741

Proposed solution:

  1. Remove the current solution and implement a new one.
  2. Take a look at the current solution and fix it.

The second solution is highly unlikely as I am not able to deduce what is actually going on in the function and why do we even need to ask for the input. If anyone can figure it out, they can submit a PR for this.

I propose the first solution.

Once the issue is fixed, we can start running this script which checks for all answers to Project Euler problems.

@dhruvmanila
Copy link
Member Author

@fpringle Can you take a look at this? Thanks if you do.

@Hyftar
Copy link
Contributor

Hyftar commented Oct 11, 2020

Hi, I will attempt to implement a new solution for this problem.

Hyftar added a commit to Hyftar/Python that referenced this issue Oct 11, 2020
Hyftar added a commit to Hyftar/Python that referenced this issue Oct 11, 2020
dhruvmanila pushed a commit that referenced this issue Oct 11, 2020
* Fixes: #3163 - Add new solution for problem 234

* Apply review suggestions
stokhos pushed a commit to stokhos/Python that referenced this issue Jan 3, 2021
…rithms#3177)

* Fixes: TheAlgorithms#3163 - Add new solution for problem 234

* Apply review suggestions
Panquesito7 pushed a commit to Panquesito7/Python that referenced this issue May 13, 2021
…rithms#3177)

* Fixes: TheAlgorithms#3163 - Add new solution for problem 234

* Apply review suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants