C++ easy peasy solution using unordered_map
Upvote if helpful :)\n\nclass Solution {\npublic:\n    vector<int> fallingSquares(vector<vector<int>>& positions) {\n       unordered_map<int,pair<int,int>> int
Upvote if helpful :)\n```\nclass Solution {\npublic:\n    vector<int> fallingSquares(vector<vector<int>>& positions) {\n       unordered_map<int,pair<int,int>> intervals;\n        \n        vector<int> output;\n        int maxheight = 0;\n        \n        for(auto v:positions){\n            int start = v[0];\n            int end = v[0]+v[1];\n            int height = v[1];\n            \n            int currmax = 0;\n            for(auto i:intervals){\n                if(i.second.first>=end || i.second.second<=start)\n                    continue;\n                \n                currmax = max(currmax,i.first);\n            }\n            int currheight = height+currmax;\n            intervals[currheight] = {start,end};\n            \n            maxheight = max(currheight,maxheight);\n            output.push_back(maxheight);\n        }\n        return output;\n    }\n};\n```
['C', 'C++']