#3111
Minimum Rectangles to Cover Points
specialist · 665 · lc medium +30 · 63.6% accepted · 109 likes · top 66%
Description
Given a 2D integer array points and an integer w, place axis-aligned rectangles (each rooted at y=0 with horizontal width at most w) to cover every point. A point on a rectangle's boundary counts as covered. Return the minimum number of rectangles needed.
Code
1
2
3