Practice Separate Squares II
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given a 2D integer array squares. Each squares[i] = [xi, yi, li] represents the coordinates of the bottom-left point and the side length of a square parallel to the x-axis. Find the minimum y-coordinate value of a horizontal line such that the total area covered by squares above the line equals the total area covered by squares below the line. Answers within 10^-5 of the actual answer will be accepted. Note: Squares may overlap. Overlapping areas should be counted only once in this version.
Source: Separate Squares II on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
squares = [[0,0,1],[2,2,1]]
1.00000
# Example 2
squares = [[0,0,2],[1,1,1]]
1.00000
Constraints
Related LeetCode Problems
Practice more problems similar to Separate Squares II.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.