Erect the Fence

From LeetCode. Convex hull (Monotone Chain). Solve the geometry problem "Erect the Fence".

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

Erect the Fence

**From LeetCode.** Convex hull (Monotone Chain). Solve the geometry problem "Erect the Fence".