A removal company must split crates between two trucks; every crate goes on exactly one truck. The crate weights are crates. Return the smallest possible difference between the two trucks' total loads.
Examples
Input: crates = [8, 3, 5, 4]
Output: 2
Explanation: 8 + 3 = 11 on one truck, 5 + 4 = 9 on the other.
Input: crates = [7]
Output: 7
Constraints
0 <= len(crates) <= 1001 <= crates[i] <= 100- There are up to
2**100splits, so do not enumerate them; the total weight is at most 10**4.
Goals
- Find every total weight one truck could carry
- Turn the set of reachable totals into the smallest imbalance