mediumArrayEnumerationGeometryMathSorting 0 views
Find the Number of Ways to Place People I
You are given a 2D array points of size n x 2 representing integer coordinates of some points on a 2D plane, where points[i] = [xi, yi].
You are given a 2D array points of size n x 2 representing integer coordinates of some points on a 2D plane, where points[i] = [xi, yi].
Count the number of pairs of points (A, B), where
Return the count.
Example 1
Input: points = [[1,1],[2,2],[3,3]]
Output: 0
Explanation: There is no way to choose A and B so A is on the upper left side of B .
Example 2
Input: points = [[6,2],[4,4],[2,6]]
Output: 2
Example 3
Input: points = [[3,1],[1,3],[1,1]]
Output: 2
Constraints
- 2 <= n <= 50
- points[i].length == 2
- 0 <= points[i][0], points[i][1] <= 50
- All points[i] are distinct.
Hints
Companies
No companies reported yet.
Discussion
Sign in to join the discussion.
Loading discussion...
Test results
No test cases yet.