Equal Sum Split
Return True if nums (positive integers) can be split into two groups with equal sums.
Requirements
- Subset-sum DP over sums up to . A Python integer used as a bitset makes this very fast.
Examples
EXAMPLE WALKTHROUGHpossible
A guided view of the published example, not a trace of your code.
INPUT
[[1,5,11,5]]TASKequal_sum_split()
EXPECTED OUTPUT
trueStart with the input values shown in this example.
Example 1 of 3
Input: nums = [1,5,11,5]
Output: true
Explanation: possible
Input: nums = [1,2,3,5]
Output: false
Explanation: impossible
Input: nums = [2,2]
Output: true
Explanation: two equal
Hint 1
If the total is odd, the answer is False.
Hint 2
Track every reachable subset sum.