boxes[i] = [w, h] spans from (0, 0) to (w, h). You also get pins pins[j] = [x, y], which are points on the plane.
A box covers a pin when 0 ≤ x ≤ w and 0 ≤ y ≤ h; pins on the edge of a box count as covered.
Return an array as long as pins whose entry j is the number of boxes covering pins[j].
Heights are tiny while widths are huge; make use of that.boxes=[[5, 3], [2, 8], [7, 7]], pins=[[2, 3], [6, 5], [8, 1]] → [3, 1, 0]
Pin (2, 3) is covered by all three boxes. Pin (6, 5) only by [7, 7]: both [5, 3] and [2, 8] are too narrow. Pin (8, 1) is covered by none, since every box is narrower than 8.
boxes=[[4, 4]], pins=[[4, 4], [1, 5]] → [1, 0]
A pin on the corner of a box counts as covered; pin (1, 5) sits above the box.
boxes=[[5, 3], [2, 8], [7, 7]], pins=[[2, 3], [6, 5], [8, 1]]
[3, 1, 0]
Run checks the first 3 tests in your browser. Submit checks all 59 tests on the server, hidden ones included.