You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Points sorted by $x$ then $-y$ since minimizing $x$ gives us the "leftmost" points and $-y$ gives us a secondary sorting based on the largest $y$ values. This lets us iterate and only check points right of a point in the list since any others are either left or above meaning the pairing has already been checked.
2
+
3
+
Since the points are sorted in such a manner, when comparing two points the only points that could be "between" are those between the two in the points[] array since values that are between $x$-wise will be sorted between them first and $y$-wise as a secondary case.
0 commit comments