Skip to content

DP-3 complete#1551

Open
KartavyaBhatt wants to merge 1 commit into
super30admin:masterfrom
KartavyaBhatt:master
Open

DP-3 complete#1551
KartavyaBhatt wants to merge 1 commit into
super30admin:masterfrom
KartavyaBhatt:master

Conversation

@KartavyaBhatt

Copy link
Copy Markdown

No description provided.

@super30admin

Copy link
Copy Markdown
Owner

Minimum Falling Path Sum (Problem1.py)

  • Strengths: The solution shows good understanding of dynamic programming with the choose/notChoose pattern, proper handling of edge cases, and clean variable naming.
  • Critical Issue: The solution solves "Delete and Earn" (LeetCode 740) instead of "Minimum Falling Path Sum" (LeetCode 931). These are fundamentally different problems requiring different approaches.
  • For Minimum Falling Path Sum: The correct approach would use DP where each cell depends on three cells below it (directly below, bottom-left, bottom-right), not a house robber-style approach.
  • Recommendation: Please re-read the problem statement carefully and implement the falling path sum algorithm using bottom-up DP or memoization where each position considers paths from the row below.

VERDICT: NEEDS_IMPROVEMENT


Delete and Earn (Problem2.py)

The student appears to have submitted code for a different LeetCode problem entirely. This suggests either:

  • Confusion about which problem to solve
  • Copy-paste error from another solution
  • Misunderstanding of the problem requirements

The submitted code is actually a solid solution for "Minimum Falling Path Sum" with proper edge case handling and in-place modification for space efficiency. However, it does not solve "Delete and Earn."

For the actual "Delete and Earn" problem, the student should:

  1. First understand that the problem is about selecting numbers and avoiding their adjacent values
  2. Use a frequency array to sum all occurrences of each value
  3. Apply the House Robber DP pattern: 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