Skip to content

Completed DP-3 exercises - #1554

Open
LakshmiPriya90-tech wants to merge 1 commit into
super30admin:masterfrom
LakshmiPriya90-tech:complete-exercises
Open

Completed DP-3 exercises#1554
LakshmiPriya90-tech wants to merge 1 commit into
super30admin:masterfrom
LakshmiPriya90-tech:complete-exercises

Conversation

@LakshmiPriya90-tech

Copy link
Copy Markdown

No description provided.

@super30admin

Copy link
Copy Markdown
Owner

Minimum Falling Path Sum (Exercise_1.py)

E completely different problem

VERDICT: NEEDS_IMPROVEMENT


Delete and Earn (Exercise_2.py)

It appears that you've submitted a solution for the wrong problem. The problem you need to solve is "Delete and Earn," not "Minimum Falling Path Sum."

For "Delete and Earn," here's the approach you should consider:

  1. Count the occurrences of each number and calculate the total points for each unique number (number × count).
  2. This transforms the problem into a "House Robber" type problem where you can't pick adjacent numbers.
  3. Use dynamic programming where dp[i] represents the maximum points you can earn considering numbers from 0 to i.
  4. The recurrence relation is: dp[i] = max(dp[i-1], points[i] + dp[i-2])

Please re-read the problem statement carefully and submit a solution that addresses the actual "Delete and Earn" problem.

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.

3 participants