Valid Square
Try to solve the Valid Square problem.
Statement
Given the coordinates of four points
Each point
A square is defined as having:
Four sides of equal positive length
Four right angles (90 degrees)
Constraints:
p1.length == p2.length == p3.length == p4.length == 2
Examples
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.