Skip to content

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

Open
aritradey-CS wants to merge 1 commit intowbhoomika:mainfrom
aritradey-CS:aritra-new-branch
Open

Add new code to fix errors in Frog_Jump.py#131
aritradey-CS wants to merge 1 commit intowbhoomika:mainfrom
aritradey-CS:aritra-new-branch

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