3711. Maximum Transactions Without Negative Balance
You are given an integer array
transactions, wheretransactions[i]represents the amount of theithtransaction:
- A positive value means money is received.
- A negative value means money is sent.
The account starts with a balance of 0, and the balance must never become negative. Transactions must be considered in the given order, but you are allowed to skip some transactions.
Return an integer denoting the maximum number of transactions that can be performed without the balance ever going negative.
1 | class Solution { |