Valid Square From Four Points in 2D

Coding: Determine Whether Four 2D Points Form a Square (Not Axis-Aligned)

Given four points p1, p2, p3, p4 on a 2D plane, each represented by integer coordinates (x, y).

Determine whether the...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: