Given a list of falling squares described by their left coordinate and side length, return the maximum height after each square lands. Each new square lands on the highest stack it overlaps with. This problem is a standard lazy propagation plus coordinate compression problem.
positions = list of falling squares
running maximum height after each square
Example 1:
Input:
positions = [[1,2],[2,3],[6,1]]
Output:
[2,5,5]
Explanation:
The first square has height 2. The second overlaps the first and stacks to height 5. The third does not overlap and leaves the maximum height at 5.
Example 2:
Input:
positions = [[100,100],[200,100]]
Output:
[100,100]
Explanation:
The squares do not overlap, so the maximum height remains 100 after each drop.