Search
⌘K

Leetcode 3454. Separate Squares II

Given axis-aligned squares (overlaps counted once), find the minimum y-coordinate of a horizontal line that splits the union area into equal halves. The core challenge is computing the union area below a candidate y (accounting for overlaps) and using its monotonicity to locate the y where that area equals half the total.

Asked at:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early September, 2024

Google

Google

Mid-level

Find a line parallel to y-axis that divides all given rectangles into equal halves

Comments

Your account is free and you can post anonymously if you choose.