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++,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala 2.11.8,
Swift,
Visual Basic

Initializing Code Editor...

{"72d3bb2": "/pagelets/suggested-problems/algorithm/help-santa/", "72d3bdf": "/pagelets/problems-hint/algorithm/help-santa/", "72d3bf4": "/pagelets/recommended-problems/algorithm/help-santa/", "72d3b94": "/pagelets/show-submission/algorithm/help-santa/", "72d3bc9": "/pagelets/problem-author-tester/algorithm/help-santa/"}

{}

realtime.hackerearth.com

80

c6dd379f9ee26ed95d15b1cb06ed793da0103222

58a29e5cae2309f04b28

/realtime/pusher/auth/