The Wayback Machine - https://web.archive.org/web/20250524161000/https://github.com/TheAlgorithms/Python/pull/3544
Skip to content

Minimum jump to reach end dynamic programming #3544

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

Conversation

hieetesh
Copy link

@hieetesh hieetesh commented Oct 19, 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}.
@hieetesh hieetesh requested a review from Kush1101 as a code owner October 19, 2020 07:39
@hieetesh
Copy link
Author

I am facing Pre-commit failure, my code is working fine. I am not able to understand the issue. Can anyone help?

@hieetesh
Copy link
Author

Hey @Kush1101, I have tested my code multiple times, its working fine. I am not able to understand this PR commit failure. Will you please help. Thanks in advance :)

@hieetesh
Copy link
Author

I have passed all the tests :)

@anneCoder1805
Copy link
Contributor

I have passed all the tests :)

Can you please let me know whta you did to overcome the issue? I, like many others am facing the same problem.

@hieetesh
Copy link
Author

Sure @anneCoder1805. Actually we have to test our code with "black" and "flake8" to make it properly indentated and to remove extra white spaces. Install black using: "pip3 install black" and then execute it using: "black filename". Same to do with flake8: pip3 install flake8 and flake8 filename. Flake8 will give you all the necessary updates you need to do to make your code pass the tests. (For example: Remove whitespace at line 17 or Line 18 is longer than 83 characters).

@anneCoder1805
Copy link
Contributor

Sure @anneCoder1805. Actually we have to test our code with "black" and "flake8" to make it properly indentated and to remove extra white spaces. Install black using: "pip3 install black" and then execute it using: "black filename". Same to do with flake8: pip3 install flake8 and flake8 filename. Flake8 will give you all the necessary updates you need to do to make your code pass the tests. (For example: Remove whitespace at line 17 or Line 18 is longer than 83 characters).

Thanks a lot.

@hieetesh
Copy link
Author

Hello @Kush1101, will you please review and accept my pull request. Thank you in advance :)

@hieetesh
Copy link
Author

@53jk1, will you please merge my pull request. Thank you in advance :)

hieetesh and others added 2 commits October 24, 2020 12:36
@hieetesh
Copy link
Author

@poyea I have added your suggested test cases. Please approve my pull request. Thanks in advance :)

Comment on lines 69 to 71
print(min_jump_to_reach_end(arr))
print(min_jump_to_reach_end([]))
print(min_jump_to_reach_end([0, 1, 10, 15, 2, 2]))
Copy link
Member

@poyea poyea Oct 24, 2020

Choose a reason for hiding this comment

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

Sorry if I've confused you. What I mean was put the test cases in the doctest. Like what you've done like:

    """
    >>> min_jump_to_reach_end([1, 3, 5, 8, 9, 2, 6, 7, 6, 8, 9])
    3
    """
@hieetesh
Copy link
Author

@poyea, Please check now

@hieetesh
Copy link
Author

@poyea , Please merge my pull request if everything looks good to you. Thank you :)

@stale
Copy link

stale bot commented Nov 28, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Used to mark an issue or pull request stale. label Nov 28, 2020
@stale
Copy link

stale bot commented Dec 6, 2020

Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!

@stale stale bot closed this Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Used to mark an issue or pull request stale.
4 participants