← Questions

Lowest horizontal line that splits squares into equal areas

0
WaymoGoogleCodingLast asked Sep 2026

Several axis-aligned squares are given by their bottom-left corner and side length. Find the lowest horizontal line y = h such that the total square area below the line equals the total area above it (squares may overlap; count overlapping area once per square). Use binary search on h or a sweep over the square edges, and handle precision.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding