There are several square blocks dropped onto the horizontal axis in a sequence. You are given a positions where each positions[i] = [left_i, sideLength_i] represents the sideLength_i falling such that its bottom left corner lands at the coordinate left_i.
Each block falls from an infinite height down to the ground or onto the top of previously dropped blocks. A square lands on top of another square if their horizontal intervals overlap across a non-zero length. If two squares only touch at their boundary edges, they do not stack on each other.
After dropping each block, determine the maximum height among all dropped squares.
Return an array of integers representing the maximum height observed after each respective square is dropped.
Constraints:
positions.length
left_i
sideLength_i
There are several square blocks dropped onto the horizontal axis in a sequence. You are given a positions where each positions[i] = [left_i, sideLength_i] represents the sideLength_i falling such that its bottom left corner lands at the coordinate left_i.
Each block falls from an infinite height down to the ground or onto the top of previously dropped blocks. A square lands on top of another square if their horizontal intervals overlap across a non-zero length. If two squares only touch at their boundary edges, they do not stack on each other.
After dropping each block, determine the maximum height among all dropped squares.
Return an array of integers representing the maximum height observed after each respective square is dropped.
Constraints:
positions.length
left_i
sideLength_i