Valid Square

Given four points represented by [[x1, y1], [x2, y2], [x3, y3], [x4, y4]] in arbitrary order, return true when they are the four distinct vertices of a square, and return false otherwise.

Examples
Input: [9,19,12,19,12,22,9,22]
Output: 1
Hints

Valid Square

Given four points represented by `[[x1, y1], [x2, y2], [x3, y3], [x4, y4]]` in arbitrary order, return `true` when they are the four distinct vertices of a square, and return `false` otherwise.