Split positions into two equal-risk books
Asked at Citadel
You have a list of position sizes and want to split them into two groups with identical total size (a crude balanced-book check). Every position must go to exactly one group.
sizes = [3, 1, 1, 2, 5]
-> True # {5, 1} = 6 and {3, 1, 2} = 6
Return whether an exact even split exists. This is subset-sum in disguise: can any subset total half the grand total?
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.