Rectangle Area II

From LeetCode. Union area with sweep line. Solve the geometry problem "Rectangle Area II".

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

Rectangle Area II

**From LeetCode.** Union area with sweep line. Solve the geometry problem "Rectangle Area II".