[Python3] brute-force
\n\nclass Solution:\n    def fallingSquares(self, positions: List[List[int]]) -> List[int]:\n        ans = []\n        for i, (x, l) in enumerate(positions): \n
\n```\nclass Solution:\n    def fallingSquares(self, positions: List[List[int]]) -> List[int]:\n        ans = []\n        for i, (x, l) in enumerate(positions): \n            val = 0\n            for ii in range(i): \n                xx, ll = positions[ii]\n                if xx < x+l and x < xx+ll: val = max(val, ans[ii])\n            ans.append(val + l)\n        for i in range(1, len(ans)): ans[i] = max(ans[i-1], ans[i])\n        return ans\n```
['Python3']