Given an array nums and integer , determine if the array can be divided into non-empty subsets with equal sum. Example: nums , . Total , target per subset . Partition: . Return true.
This needs bitmask DP because you must track exactly which elements have been used. Standard sum-based DP can't distinguish different groupings that reach the same partial sum.