Easy Java Solution O(n^2)
Code\n\nclass Solution {\n    public List<Integer> fallingSquares(int[][] positions) {\n        // create ans list\n        List<Integer> ans = new ArrayList<>(
# Code\n```\nclass Solution {\n    public List<Integer> fallingSquares(int[][] positions) {\n        // create ans list\n        List<Integer> ans = new ArrayList<>();\n        // create list of intervals we\'ve already\n        // visited\n        List<int[]> checked = new ArrayList<>();\n        // create 2d array of positions {x1, x2, height} \n        // same as input in skyline problem #218\n        int[][] skyline = new int[positions.length][3];\n        for (int i = 0; i < skyline.length; i++) {\n            skyline[i] = new int[]{positions[i][0], positions[i][0]+positions[i][1], positions[i][1]};\n        }\n        // initialize max to height of first square dropped\n        int max = skyline[0][2];\n        // add max to list at the same index as skyline\'s index\n        ans.add(0, max);\n        // add same square to checked list\n        checked.add(skyline[0]);\n        // iterate through the squares\n        for (int i = 1; i < skyline.length; i++) {\n            int preMax = 0;\n            // iterate through checked squares\n            for (int[] prev : checked) {\n                // if checked square overlaps current square, \n                // then compare it\'s height with current height \n                // and assign result to preMax.\n                if ((skyline[i][0] < prev[1]) && (skyline[i][1] > prev[0])) {\n                    preMax = Math.max(preMax, prev[2]);\n                } \n            }\n            // add preMax to current square\'s height\n            skyline[i][2] += preMax;\n            // add square to checked list\n            checked.add(skyline[i]);\n            // compare square\'s new height to max height of all squares and change max\n            max = Math.max(max, skyline[i][2]);\n            // add the new max to ans list at same index as current square\'s index\n            ans.add(i, max);\n        }\n        return ans;\n    }\n}\n```
['Java']