c++ || easy ||
\nclass Solution {\npublic:\n    long long minimumMoney(vector<vector<int>>& t) {\n        \n        \n        int mn=INT_MAX;\n        int  mx=INT_MIN;\n      
```\nclass Solution {\npublic:\n    long long minimumMoney(vector<vector<int>>& t) {\n        \n        \n        int mn=INT_MAX;\n        int  mx=INT_MIN;\n        long long ans=0;\n        for(auto it:t)\n        {\n            mn = min(it[0],it[1]);\n            mx=max(mx,mn);\n        }\n            \n        for(auto it:t)\n        {\n            ans += max(it[0]-it[1],0);\n        }\n        ans+=mx;   \n        return ans;\n    }\n};\n```
[]