## [Solution] Count Number of Rectangles Containing Each Point Solution Leetcode

You are given a 2D integer array `rectangles`

where `rectangles[i] = [l`

indicates that _{i}, h_{i}]`i`

rectangle has a length of ^{th}`l`

and a height of _{i}`h`

. You are also given a 2D integer array _{i}`points`

where `points[j] = [x`

is a point with coordinates _{j}, y_{j}]`(x`

._{j}, y_{j})

The `i`

rectangle has its ^{th}**bottom-left corner** point at the coordinates `(0, 0)`

and its **top-right corner** point at `(l`

._{i}, h_{i})

Return* an integer array *`count`

* of length *`points.length`

* where *`count[j]`

* is the number of rectangles that contain the *

`j`^{th}

*point.*

The `i`

rectangle ^{th}**contains** the `j`

point if ^{th}`0 <= x`

and _{j} <= l_{i}`0 <= y`

. Note that points that lie on the _{j} <= h_{i}**edges** of a rectangle are also considered to be contained by that rectangle.

**Example 1: [Solution] Count Number of Rectangles Containing Each Point Solution Leetcode**

Input:rectangles = [[1,2],[2,3],[2,5]], points = [[2,1],[1,4]]Output:[2,1]Explanation:The first rectangle contains no points. The second rectangle contains only the point (2, 1). The third rectangle contains the points (2, 1) and (1, 4). The number of rectangles that contain the point (2, 1) is 2. The number of rectangles that contain the point (1, 4) is 1. Therefore, we return [2, 1].

**Example 2: [Solution] Count Number of Rectangles Containing Each Point Solution Leetcode**

Input:rectangles = [[1,1],[2,2],[3,3]], points = [[1,3],[1,1]]Output:[1,3]Explanation:The first rectangle contains only the point (1, 1). The second rectangle contains only the point (1, 1). The third rectangle contains the points (1, 3) and (1, 1). The number of rectangles that contain the point (1, 3) is 1. The number of rectangles that contain the point (1, 1) is 3. Therefore, we return [1, 3].

**Constraints: [Solution] Count Number of Rectangles Containing Each Point Solution Leetcode**

`1 <= rectangles.length, points.length <= 5 * 10`

^{4}`rectangles[i].length == points[j].length == 2`

`1 <= l`

_{i}, x_{j}<= 10^{9}`1 <= h`

_{i}, y_{j}<= 100- All the
`rectangles`

are**unique**. - All the
`points`

are**unique**.