O(n*n) calculate height of each square
Intuition
Calculate height of each square
Compare and get result of "height of the current tallest stack of squares."
???? why this problem is hardComplexity

T
# Intuition
- Calculate height of each square
- Compare and get result of "height of the current tallest stack of squares."

???? why this problem is hard

# Complexity
- Time complexity: O(n*n)

- Space complexity:O(n)

# Code
```golang []

func fallingSquares(positions [][]int) []int {
	rs := make([]int, 1)
	rs[0] = positions[0][1]
	for i := 1; i < len(positions); i++ {
		mx := 0
		for j := range rs {
			if positions[j][0] < positions[i][0]+positions[i][1] && positions[j][1]+positions[j][0] > positions[i][0] {
				mx = max(mx, rs[j])
			}
		}
		rs = append(rs, positions[i][1]+mx)
	}
	for i := 1; i < len(rs); i++ {
		if rs[i] < rs[i-1] {
			rs[i] = rs[i-1]
		}
	}
	return rs
}
```
['Go']