The Wayback Machine - https://web.archive.org/web/20201126013246/https://github.com/TheAlgorithms/Python/pull/3820
Skip to content
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

Goldmine Problem with question link #3820

Open
wants to merge 1 commit into
base: master
from

Conversation

@kaushalendra-pandey
Copy link

@kaushalendra-pandey kaushalendra-pandey commented Oct 29, 2020

Describe your change:

  • [ # ] Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • [* ] This pull request is all my own work -- I have not plagiarized.
  • [ *] I know that pull requests will not be merged if they fail the automated tests.
  • [ *] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [ *] All new Python files are placed inside an existing directory.
  • [ *] All filenames are in all lowercase characters with no spaces or dashes.
  • [ *] All functions and variable names follow Python naming conventions.
  • [* ] All function parameters and return values are annotated with Python type hints.
  • [ *] All functions have doctests that pass the automated testing.
  • [ *] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [ *] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
@kaushalendra-pandey kaushalendra-pandey requested a review from Kush1101 as a code owner Oct 29, 2020
@mrmaxguns
Copy link
Contributor

@mrmaxguns mrmaxguns commented Nov 5, 2020

Here is why the pre-commit failed:

  1. End of file fixer failed because the file must end in one newline.
  2. Black failed. Make sure to run black . before submitting a pull request. (Install black with pip install black)

Travis failed because your program needed input while Pytest was running. Fix this issue by putting the algorithm in a function.


#Question Problem : https://leetcode.com/problems/path-with-maximum-gold/

n = int(input().strip())

This comment has been minimized.

@mrmaxguns

mrmaxguns Nov 5, 2020
Contributor

One-letter variable names are not acceptable.

n = int(input().strip())
m = int(input().strip())
arr = [[0]*m for _ in range(n)]
print(arr)

This comment has been minimized.

@mrmaxguns

mrmaxguns Nov 5, 2020
Contributor

Algorithms should not have any side-effects. Consider creating two functions: one for the algorithm itself, and another that invokes this function and prints output.

for i in range(n):
arr[i] = [int(j) for j in input().strip().split(" ")]

dp = [[0]*m for _ in range(n)]

This comment has been minimized.

@mrmaxguns

mrmaxguns Nov 5, 2020
Contributor

Do not use abbreviations for variable names. Readability is key when writing code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.