Problem 3711 · Medium

Maximum Transactions Without Negative Balance

Keep transactions in order while the balance stays nonnegative, dropping the most negative kept amount whenever it dips.

Open the interactive visualisation