Santa has arrived.He tells you that due to demonetization there is a shortage of gifts.So he asks to find some standard gifts for him.A gift is a stantard gift if its 4 endpoints on a Cartesian plane form a square.So given the end points Return true if these points form a square, and false otherwise.
For input:0 0 0 3 3 3 3 0 the output should be true
Here's what figure the points form:
[time limit]:250 s [input] array.integer points
Input is 8 integers. It is guaranteed that all points are unique.
Note, that the points can be given in random order.
Constraints: points.length = 8, -105 ≤ points ≤ 105.
true if the given points form a square, false otherwise.