Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Monday, Dec 7.Claim the deal

A financial account ledger processes funding requests for accounts. You are given commands, an array of space-separated command strings. Money amounts are integer minor units, such as cents. A funding request counts toward an account's balance only after it settles.

All "INIT" commands precede timestamped commands. Timestamped commands use a whole-number day and are given in chronological order. If multiple commands share a day, process them in input order.

A "BALANCE" on day d reports the settled balance at the point it occurs: the starting balance plus earlier accepted funding requests whose settlement day is at most d. A later "FUND" cannot change an earlier "BALANCE", even on the same day.

Test Cases
Input
Output
Expected