Self Crossing

From LeetCode. Self-intersecting polygon. Solve the geometry problem "Self Crossing".

Examples
Input: [2,1,1,2]
Output: 1
Hints

Self Crossing

**From LeetCode.** Self-intersecting polygon. Solve the geometry problem "Self Crossing".