Back to DSA
Partition Equal Subset Sum
mediumDetermine whether an integer array can be split into two groups such that both groups have identical sums.
Examples
Example 1:
Input:
nums = [3,3,3,4,5]Output:
trueExplanation: One valid split is {3,3,3} and {4,5}, both summing to 9.
Example 2:
Input:
nums = [1,2,5]Output:
falseExplanation: Total is 8, which is even, but no subset sums to 4.
Hints
1234567