Partition Equal Subset Sum
Medium
LC #416
0/1 knapsacksubset sumNot attempted yet
Return True if nums can be split into two groups
(every number in exactly one group) whose sums are equal.
Example 1
Input: nums = [1, 5, 11, 5]
Output: True
[1, 5, 5] and [11]
Example 2
Input: nums = [1, 2, 3, 5]
Output: False
Example 3
Input: nums = [3, 3, 3, 4, 5]
Output: True
[3, 3, 3] and [4, 5]
Constraints
- 1 ≤ len(nums) ≤ 200
- 1 ≤ nums[i] ≤ 100