Accepted C# Solution with Segment Tree
\n    public class Solution\n    {\n        private class SegTree\n        {\n            public class Node\n            {\n                public readonly long
```\n    public class Solution\n    {\n        private class SegTree\n        {\n            public class Node\n            {\n                public readonly long Left;\n                public readonly long Right;\n\n                public Node(long left, long right)\n                {\n                    Left = left;\n                    Right = right;\n                }\n\n                public Node LeftChild;\n                public Node RightChild;\n                public bool IsLeaf => LeftChild == null && RightChild == null;\n                public long Max;\n            }\n\n            public readonly Node Root;\n\n            public SegTree(long min, long max)\n            {\n                Root = new Node(min, max);\n            }\n\n            public long GetHeight(Node node, long from, long to)\n            {\n                if (from > node.Right || to < node.Left)\n                {\n                    return 0;\n                }\n\n                if (node.IsLeaf)\n                {\n                    return node.Max;\n                }\n\n\n                long leftCand = GetHeight(node.LeftChild, Math.Max(from, node.LeftChild.Left), Math.Min(to, node.LeftChild.Right));\n                long rightCand = GetHeight(node.RightChild, Math.Max(from, node.RightChild.Left), Math.Min(to, node.RightChild.Right));\n\n                return Math.Max(leftCand, rightCand);\n            }\n\n            public void Cover(Node node, long from, long to, long height)\n            {\n                if (from > node.Right || to < node.Left)\n                {\n                    return;\n                }\n\n                if (node.Left == from && node.Right == to)\n                {\n                    node.LeftChild = null;\n                    node.RightChild = null;\n                    node.Max = height;\n                    return;\n                }\n\n                if (node.Right == node.Left)\n                {\n                    node.Max = height;\n                    return;\n                }\n\n                if (node.IsLeaf)\n                {\n                    long mid = node.Left + (node.Right - node.Left) / 2;\n                    node.LeftChild = new Node(node.Left, mid);\n                    node.RightChild = new Node(mid + 1, node.Right);\n                }\n\n                Cover(node.LeftChild, Math.Max(from, node.LeftChild.Left), Math.Min(to, node.LeftChild.Right), height);\n                Cover(node.RightChild, Math.Max(from, node.RightChild.Left), Math.Min(to, node.RightChild.Right), height);\n\n                node.Max = Math.Max(node.LeftChild.Max, node.RightChild.Max);\n\n                if (node.LeftChild != null && node.RightChild != null)\n                {\n                    if (node.LeftChild.IsLeaf && node.RightChild.IsLeaf && node.LeftChild.Max == node.RightChild.Max)\n                    {\n                        //remove reduntant childs when parent interval is fully covered\n                        node.LeftChild = null;\n                        node.RightChild = null;\n                    }\n                }\n            }\n        }\n\n\n        public IList<int> FallingSquares(int[][] positions)\n        {\n            checked\n            {\n                long maxHeight = 0;\n                IList<int> res = new List<int>(positions.Length);\n                long min = int.MaxValue;\n                long max = int.MinValue;\n\n                foreach (var square in positions)\n                {\n                    min = Math.Min(min, square[0]);\n                    max = Math.Max(max, (long) square[0] + square[1]);\n                }\n\n                SegTree tree = new SegTree(min, max);\n\n                foreach (var square in positions)\n                {\n                    long left = square[0];\n                    long size = square[1];\n                    long right = left + size - 1;\n\n                    var currentHeight = tree.GetHeight(tree.Root, left, right);\n                    currentHeight += size;\n                    tree.Cover(tree.Root, left, right, currentHeight);\n\n                    maxHeight = Math.Max(maxHeight, currentHeight);\n                    res.Add((int)maxHeight);\n                }\n\n                return res;\n            }\n        }\n    }\n```
['Tree']