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.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected