Greedy
\nclass Solution:\n    def minimumMoney(self, transactions: List[List[int]]) -> int:\n        re = 0\n        m = 0\n        for i in transactions:\n           
```\nclass Solution:\n    def minimumMoney(self, transactions: List[List[int]]) -> int:\n        re = 0\n        m = 0\n        for i in transactions:\n            if i[0] - i[1] > 0: \n                re += i[0] - i[1]\n                m = max(m, i[1])\n            else:\n                m = max(m, i[0])\n        return re + m\n```
[]