Subset sum optimization
Filed under MathWorks
The question
Given an array S, partition it into two subsets A and B such that A intersection B is empty, union is S, sum of A > sum of B, and size of A is minimized. Return sorted A with maximal sum.
No write-up yet. Related questions below have one.
Related MathWorks questions
Collected from public candidate posts and coding forums. Updated Nov 2026.