Simple python3 solution with comments
Complexity\n- Time complexity: O(n \cdot \log(n)) \n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n) \n Add your space complexity here, e.
# Complexity\n- Time complexity: $$O(n \\cdot \\log(n))$$ \n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$ \n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nfrom sortedcontainers import SortedList\n\nclass Solution:\n    def fallingSquares(self, positions: List[List[int]]) -> List[int]:\n        data = SortedList()\n\n        max_height = 0\n        result = []\n\n        for left, side_length in positions:\n            u, v = left, left + side_length\n            current_height = side_length\n\n            index = data.bisect_left((u, u, 0))\n            if index != 0:\n                index -= 1\n            \n            while index != len(data):\n                x, y, other_height = data[index]\n                if y <= u:  # old square is to the left of new square\n                    index += 1\n                    continue\n                elif v <= x:  # old square is to the right of new square\n                    break\n                else:  # old and new squares intersect\n                    current_height = max(current_height, side_length + other_height)\n                    data.pop(index)\n\n                    if x < u:  # update left part of old square\n                        data.add((x, u, other_height))\n                        index += 1\n                    \n                    if v < y:  # update right part of old square\n                        data.add((v, y, other_height))\n                        index += 1                \n            \n            data.add((u, v, current_height))\n            \n            max_height = max(max_height, current_height)\n            result.append(max_height)\n        \n        return result\n```
['Greedy', 'Ordered Set', 'Python3']