C++ Solution || O(n) TC & O(1) SC || 8 Lines || One pass
\nclass Solution {\npublic:\n    static int64_t minimumMoney(const vector<vector<int>>& transactions) {\n        int best = 0;\n        int64_t ret = 0;\n      
```\nclass Solution {\npublic:\n    static int64_t minimumMoney(const vector<vector<int>>& transactions) {\n        int best = 0;\n        int64_t ret = 0;\n        for (auto& tx: transactions) {\n            best = max(best, min(tx[0], tx[1]));\n            if (tx[1] < tx[0])\n                ret += tx[0] - tx[1];\n        }\n        return ret + best;\n    }\n};\n```
[]