Python 3 || 9 lines,  bisect || T/S: 99% / 81%
\nclass Solution:\n    def fallingSquares(self, positions: List[List[int]]) -> List[int]:\n\n        def helper(box: List[int])->int:\n\n            l, h = box\
```\nclass Solution:\n    def fallingSquares(self, positions: List[List[int]]) -> List[int]:\n\n        def helper(box: List[int])->int:\n\n            l, h = box\n            r = l + h\n            \n            i, j = bisect_right(pos, l), bisect_left (pos, r)\n\n            res = h + max(hgt[i-1:j], default = 0)\n            pos[i:j], hgt[i:j] = [l, r], [res, hgt[j - 1]]\n\n            return res\n\n       \n        hgt, pos, res, mx = [0], [0], [], 0\n        \n        return accumulate(map(helper, positions), max)\n```\n[https://leetcode.com/problems/falling-squares/submissions/1271687553/](https://leetcode.com/problems/falling-squares/submissions/1271687553/)\n\n\nI could be wrong, but I think that time complexity is *O*(*N*log*N*) and space complexity is *O*(*N*), in which *N* ~ `len(positions)`.
['Python3']