Valid Square

From LeetCode. Square from 4 points. Solve the geometry problem "Valid Square".

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

Valid Square

**From LeetCode.** Square from 4 points. Solve the geometry problem "Valid Square".