SOLVE

LATER

Help Santa

Problem

Editorial

Analytics

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.

Explanation

For input:0 0 0 3 3 3 3 0 the output should be true

Here's what figure the points form:

.

**Input/Output**

*[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.

*[output] boolean*

true if the given points form a square, false otherwise.

Time Limit:
2.5 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Visual Basic,
Kotlin

Initializing Code Editor...

{"53ea6fe": "/pagelets/suggested-problems/algorithm/help-santa/", "53ea718": "/pagelets/problem-author-tester/algorithm/help-santa/", "53ea72f": "/pagelets/problems-hint/algorithm/help-santa/", "53ea6cb": "/pagelets/show-submission/algorithm/help-santa/", "53ea744": "/pagelets/recommended-problems/algorithm/help-santa/"}

{}

realtime.hackerearth.com

80

c6dd379f9ee26ed95d15b1cb06ed793da0103222

58a29e5cae2309f04b28

/realtime/pusher/auth/