Valid Square
Four points [x, y] are given in any order. Return True if they are the corners of a square with positive side length, otherwise False.
Example 1
p1 [0,0]
p2 [1,1]
p3 [1,0]
p4 [0,1]
returns true
A unit square.
Constraints
- Each point has two integer coordinates between -100 and 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.