You are given an array transactions where transactions[i] = [cost_i, cashback_i].
The array represents a series of transactions that must be completed:
You must possess at least cost_i money before performing the transaction.
After paying cost_i, you receive cashback_i.
Return the minimum initial amount of money required so that all transactions can be completed regardless of the order in which they are processed.
Constraints:
transactions.length
transactions[i].length
cost_i, cashback_i
You are given an array transactions where transactions[i] = [cost_i, cashback_i].
The array represents a series of transactions that must be completed:
You must possess at least cost_i money before performing the transaction.
After paying cost_i, you receive cashback_i.
Return the minimum initial amount of money required so that all transactions can be completed regardless of the order in which they are processed.
Constraints:
transactions.length
transactions[i].length
cost_i, cashback_i