python4beginners-Hacktoberfest23 icon indicating copy to clipboard operation
python4beginners-Hacktoberfest23 copied to clipboard

Add new code to fix errors in Frog_Jump.py

Open aritradey-CS opened this issue 1 year ago • 0 comments

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

aritradey-CS avatar Oct 12 '23 18:10 aritradey-CS