#3025
Find the Number of Ways to Place People I
medium · 64% accepted · 482 likes · top 67%
array · math · geometry · sorting · enumeration
Description
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
- A is on the upper left side of B, and
- there are no other points in the rectangle (or line) they make (including the border), except for the points A and B.
Return the count.
Solution