Search
⌘K

Leetcode 1049. Last Stone Weight II

Split the stones into two groups to minimize the absolute difference of their total weights — equivalent to finding the largest subset sum ≤ total_sum/2 (a subset-sum / 0-1 knapsack DP problem). With n ≤ 30 and weights ≤ 100, the total sum is small enough for DP over sums.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.