dp3#1533
Conversation
Least Falling Path Sum (min-falling-path-sum.py)Your solution is excellent! It correctly implements a dynamic programming approach with optimal time complexity. Here are some strengths and suggestions for improvement: Strengths:
Areas for Improvement:
Overall, your solution is very good and passes all criteria. The space optimization is optional but recommended. VERDICT: PASS Delete and Earn (delete-and-earn.py)Your approach is on the right track: you recognized that the problem can be reduced to a dynamic programming problem similar to the "house robber" problem. However, there is a critical issue in your code: you did not initialize the base cases for the dynamic programming array correctly. Specifically, you are using the same array
In your code, you start the loop at index 2, but you never set For example, consider But consider another example: Now consider Now consider a case where the base case matters: VERDICT: NEEDS_IMPROVEMENT |
No description provided.