
There are several squares being dropped onto the X-axis of a 2D plane.
You are given a 2D integer array positions where positions[i] = [left _i , sideLength _i ] represents the i ^th square with a side length of sideLength _i that is dropped with its left edge aligned with X-coordinate left _i .
Each square is dropped one at a time from a height above any landed squares. It then falls downward (negative Y direction) until it either lands on the top side of another square or on the X-axis . A square brushing the left/right side of another square does not count as landing on it. Once it lands, it freezes in place and cannot be moved.
After each square is dropped, you must record the height of the current tallest stack of squares .
Return an integer array ans where ans[i] represents the height described above after dropping the i ^th square .
1 <= positions.length <= 10001 <= left _i <= 10 ^81 <= sideLength _i <= 10 ^6