Easy AC SEGMENT TREE SOLUTION
Intuitionmy first thought is using segmenttree to save the status o every position but it's to large. So I decide to use Segment Tree MapApproachFirst I use Seg
# Intuition
my first thought is using segmenttree to save the status o every position but it's to large. So I decide to use Segment Tree Map

# Approach
First I use Segment Tree Map to save to height of every position we visited, i use lazy tree to make my programme faster, we just update the bigger node which include smaller node
# Code
```cpp []
class Solution {
public:
    map < long long , long long > segment;
    map < long long , long long > lazy;
void lazy_prog ( long long seed , long long low , long long high )
{
    if ( lazy[seed] )
    {
        segment[seed] = lazy[seed];
        if ( low != high )
        {
            lazy[seed*2+1] = lazy[seed];
            lazy[seed*2+2] = lazy[seed];
        }
        lazy[seed] = 0;
        
    }
}
long long findhighest ( long long seed , long long blow , long long bhigh , long long low , long long high )
{
    lazy_prog ( seed , blow , bhigh );
    if ( blow >= low && bhigh <= high ) return segment[seed];
    if ( blow > high || bhigh < low ) return 0;
    long long mid = ( blow + bhigh ) / 2;
    return max ( findhighest( seed*2 + 1 , blow , mid , low , high )
                , findhighest ( seed*2 + 2 , mid + 1, bhigh , low , high ) );
}
void add ( long long seed , long long blow , long long bhigh , long long low , long long high , long long key )
{
    lazy_prog ( seed , blow , bhigh );
    if ( blow >= low && bhigh <= high ){
        segment[seed] = key;
        lazy[seed] = key;
        return;
    }
    if ( blow > high || bhigh < low ) return;
    
    long long mid = ( blow + bhigh ) / 2;
    add ( seed*2 + 1 , blow , mid , low , high , key );
    add ( seed*2 + 2 , mid + 1 , bhigh , low , high , key );
    segment[seed] = max(segment[seed*2+1] , segment[seed*2+2] );
}
    vector<int> fallingSquares(vector<vector<int>>& positions) {
        vector < int > result ;
        long long l , r, height;
        for ( int i = 0 ; i < positions.size() ; i ++ )
        {
            for ( int j = 0 ; j < 2 ; j ++ )
            {
                if ( j == 0 ) l = positions[i][j];
                else {
                    r = l + positions[i][j] - 1;
                    height = positions[i][j];
                }
            }
            long long highest = findhighest ( 0 , 0 , 101000005, l , r );
            add ( 0 , 0 , 101000005, l , r, highest + height );
            result.push_back(segment[0]);
        }
        return result ;
    }
};
```
['Tree', 'Segment Tree', 'Recursion', 'C++']