Search
⌘K
Get Premium
Leetcode 1981. Minimize the Difference Between Target and Chosen Elements
Pick one element from each row so the total sum is as close as possible to target; this is essentially a row-by-row reachable-sums/subset-sum (knapsack-like) problem where you compute which sums are attainable and return the minimum absolute difference, with target and value bounds making DP feasible.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.