You are given a points of size n $ imes 2$, where points[i]
A pair of points (A, B) is considered valid if:
Point A is to the upper left of point B, meaning A[0] B[0] and A[1] B[1].
No other point C lies inside or on the border of the rectangle formed with A as its upper left corner and B as its lower right corner. That is, there is no point C other than A and B such that A[0] C[0] B[0] and B[1] C[1] A[1].
Return the total number of valid pairs (A, B).
Constraints:
n n == points.length
points[i].length
points[i][0], points[i][1]
All elements in points are distinct.
You are given a points of size n $ imes 2$, where points[i]
A pair of points (A, B) is considered valid if:
Point A is to the upper left of point B, meaning A[0] B[0] and A[1] B[1].
No other point C lies inside or on the border of the rectangle formed with A as its upper left corner and B as its lower right corner. That is, there is no point C other than A and B such that A[0] C[0] B[0] and B[1] C[1] A[1].
Return the total number of valid pairs (A, B).
Constraints:
n n == points.length
points[i].length
points[i][0], points[i][1]
All elements in points are distinct.