Write a program or function that takes in a nonempty list of positive integers. You may assume it is input in a reasonable convenient format such as "1 2 3 4" or [1, 2, 3, 4].
The numbers in the input list represent the slices of a full pie chart where each slice size is proportional to its corresponding number and all slices are arranged around the chart in the order given.
For example, the pie for 1 2 3 4 is:
The question your code must answer is: Is the pie chart ever bisected? That is, is there ever a perfectly straight line from one side of the circle to the other, splitting it symmetrically in two?
You need to output a truthy value if there is at least one bisector and output a falsy value if there are none.
In the 1 2 3 4 example there is a bisection between 4 1 and 2 3 so the output would be truthy.
But for input 1 2 3 4 5 there is no bisector so the output would be falsy:
Additional Examples
Arranging numbers differently may remove bisectors.
e.g. 2 1 3 4 → falsy:
If only one number is in the input list the pie is not bisected.
e.g. 10 → falsy:
There may be multiple bisectors. As long as there are more than zero the output is truthy.
e.g. 6 6 12 12 12 11 1 12 → truthy: (there are 3 bisectors here)
Bisections may exist even if they are not visually obvious.
e.g. 1000000 1000001 → falsy:
e.g. 1000000 1000001 1 → truthy:
(Thanks to nces.ed.gov for generating the pie charts.)
Test Cases
Truthy 1 2 3 4 6 6 12 12 12 11 1 12 1000000 1000001 1 1 2 3 1 1 42 42 1 17 9 13 2 7 3 3 1 2 10 20 10 Falsy 1 2 3 4 5 2 1 3 4 10 1000000 1000001 1 1 2 3 1 1 1 2 1 2 1 2 10 20 10 1 Scoring
The shortest code in bytes wins. Tiebreaker is earlier answer.






