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

Add new code to fix errors in Frog_Jump.py #131

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aritradey-CS
Copy link

Two implementations

one using a stack and another using dynamic programming (dp). Both implementations are correct, but the dp implementation is not very efficient. The issue with the dp implementation is that it has a time complexity of O(n^2) in the worst case, making it less efficient for larger inputs.

If you want to improve the efficiency of the dp implementation, you can use a dictionary to store the valid jump sizes for each stone, which will reduce the lookup time.

Thank you for your consideration @wbhoomika

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.

1 participant