#3025

Find the Number of Ways to Place People I

specialist · 680 · lc medium +30 · 64% accepted · 482 likes · top 67%

Description

You are given a 2D array points of size n x 2 representing integer coordinates on a 2D plane.

Count the ordered pairs (A, B) where:

- A is strictly to the upper-left of B.

- No other point lies inside or on the border of the rectangle defined by A (upper-left corner) and B (lower-right corner).

Return the count.

Code

1
2
3