105. Partition Into Two Equal-Sum Subsets
MediumDynamic programming
Return true if the positive integers in nums can be split into two groups with equal sums. Every number must go in exactly one group.
Example 1
Input: nums = [1, 5, 11, 5] Output: true Explanation: [1, 5, 5] and [11]
Example 2
Input: nums = [1, 2, 3, 5] Output: false
Constraints
1 ≤ nums.length ≤ 2001 ≤ nums[i] ≤ 100