3111. Minimum Rectangles to Cover Points

You are given a 2D integer array

`points`

, where`points[i] = [xi, yi]`

. You are also given an integer`w`

. Your task is tocoverallthe given points with rectangles.Each rectangle has its lower end at some point

`(x1, 0)`

and its upper end at some point`(x2, y2)`

, where`x1 <= x2`

,`y2 >= 0`

, and the condition`x2 - x1 <= w`

mustbe satisfied for each rectangle.A point is considered covered by a rectangle if it lies within or on the boundary of the rectangle.

Return an integer denoting the

minimumnumber of rectangles needed so that each point is covered byat least onerectangle.

Note:A point may be covered by more than one rectangle.

1 | class Solution { |