<p>Given the coordinates of four points in 2D space <code>p1</code>, <code>p2</code>, <code>p3</code> and <code>p4</code>, return <code>true</code><em>if the four points construct a square</em>.</p>
<p>The coordinate of a point <code>p<sub>i</sub></code> is represented as <code>[x<sub>i</sub>, y<sub>i</sub>]</code>. The input is <strong>not</strong> given in any order.</p>
<p>A <strong>valid square</strong> has four equal sides with positive length and four equal angles (90-degree angles).</p>