Fairest Split — Solution & Editorial
N ≤ 16 invites 2N enumeration of subsets: each mask's sum s gives difference |total − 2s|. (Meet-in-the-middle scales to N = 32.)
Complexity: O(2N · N)
N ≤ 16 invites 2N enumeration of subsets: each mask's sum s gives difference |total − 2s|. (Meet-in-the-middle scales to N = 32.)
Complexity: O(2N · N)