Google SDEIII L4 Interview Experience | 65LPA - 85LPA | Please Help
Anonymous User
764

Round 3 -

You are given n axis-aligned rectangles on a 2D plane. Each rectangle is defined by its bottom-left and top-right corners:

Rectangle [i] = [x1, y1, x2, y2]
where (x1, y1) is bottom-left, (x2, y2) is top-right, and x1 < x2, y1 < y2
Your task is to find:

The maximum number of rectangles that cover or touch any single point

Return that maximum count

If no two rectangles overlap, return 1 (each point in a rectangle is covered by at least that rectangle).

Note: "Cover or touch" means if a point lies on the boundary (edge or corner), it's considered covered.

[x,y] belongs to [1.....100000]

Comments (2)