Problem 1049 · Medium

Last Stone Weight II

Split the stones into two groups with the smallest possible difference, so the leftover weight is minimized. A subset-sum table shows which totals can be reached.

Open the interactive visualisation