#3453

Separate Squares I

specialist · 760 · lc medium +31 · 58% accepted · 673 likes · top 54%

Description

Given a 2D array squares where each entry squares[i] = [xi, yi, li] describes an axis-aligned square by its bottom-left corner and side length, find the minimum y-coordinate of a horizontal line that divides the total square area equally above and below.

An answer within 10-5 of the true value is acceptable.

Note: Overlapping regions count once for each square that covers them.

Code

1
2
3