Skip to content

Completed DP-3#1549

Open
Sanket-S-Kale wants to merge 1 commit into
super30admin:masterfrom
Sanket-S-Kale:master
Open

Completed DP-3#1549
Sanket-S-Kale wants to merge 1 commit into
super30admin:masterfrom
Sanket-S-Kale:master

Conversation

@Sanket-S-Kale

Copy link
Copy Markdown

No description provided.

@super30admin

Copy link
Copy Markdown
Owner

Least Falling Path Sum (Problem1.py)

  1. Critical Issue - Wrong Problem: You solved "Delete and Earn" instead of "Least Falling Path Sum". This is a fundamental mistake. Always verify you're solving the correct problem before submitting.

  2. Strengths: Your code is well-documented with clear time and space complexity analysis for your chosen problem. The variable naming is clear and the logic is clean.

  3. If you want to solve the correct problem: For "Least Falling Path Sum", you should use dynamic programming starting from the last row and working upward, or use recursion with memoization. The approach would be to compute the minimum sum to reach each cell by considering the three possible paths from the row above.

  4. For the problem you solved: Your solution is efficient and correct for "Delete and Earn".

VERDICT: NEEDS_IMPROVEMENT


Delete and Earn (Problem2.py)

  1. Critical Issue: The solution solves the wrong problem. The student appears to have copied code from a different LeetCode problem (Minimum Falling Path Sum) instead of implementing the Delete and Earn solution.

  2. Code Quality: The code itself is well-structured, readable, and properly commented. The approach to the (wrong) problem is correct.

  3. Time/Space Complexity: For the wrong problem, the complexity analysis is accurate, but it's irrelevant since this isn't the requested problem.

  4. Missing Solution: The student has not provided any solution for "Delete and Earn" - only for a different problem entirely.

To improve, the student needs to:

  • Implement the actual Delete and Earn algorithm (house robber pattern)
  • Understand that nums[i] can be up to 10^4, so we need to build a frequency array
  • Apply the recurrence: take current value or skip (dp[i] = max(dp[i-1], arr[i] + dp[i-2]))

VERDICT: NEEDS_IMPROVEMENT

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.

2 participants