Closest to the Origin — Solution & Editorial
Compare SQUARED distances in integers (no sqrt, no floats); the tuple (d², x, y) implements the tie-break directly.
Complexity: O(N)
Compare SQUARED distances in integers (no sqrt, no floats); the tuple (d², x, y) implements the tie-break directly.
Complexity: O(N)