Shortest Solution Here!

google
Tags: #<Tag:0x00007f1825654bb0>

#1
int ans = 0 ;
    int m =  INT_MAX;
    for(auto i:A){
        ans = max(ans,i-m);
        m = min(i,m);
    }
    return ans;