NeetCode #675LC-740Medium1-D Dynamic Programming
← Back to All Problems#675 · #740 · Delete and Earn(删除并获得点数)
📌 Problem Statement & Constraints
You are given an integer array
nums. You may delete elements, earning points equal to the value deleted, but deleting a value x also removes every element equal to x - 1 or x + 1 without earning. Return the maximum points you can earn. Constraints: 1 <= nums.length <= 2 * 10^4, 1 <= nums[i] <= 10^4.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!