Detect Squares

From LeetCode. Count axis-aligned squares. Solve the geometry problem "Detect Squares".

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

Detect Squares

**From LeetCode.** Count axis-aligned squares. Solve the geometry problem "Detect Squares".