Solution (source code)

= Solution

Use an <abstract data type> with two total count <functions>, $I,O:U\to\{0,\ldots,M\}$, where $U=\{1,\ldots,99999999\}$ and $M=2^{31}-1$. $I(u)$ counts incoming payments and $O(u)$ outgoing payments. Initially \b[$I(u)=O(u)=0$ for every valid user]. A user without a stored record is therefore observable as two zero counts; no separate registration operation is necessary.

The explicit bound $M$ matches the source's `Int` record fields. Increment operations require space in the relevant count, so no <integer overflow> is permitted. An unbounded mathematical counting <abstract data type> would instead require an arbitrary-precision representation or an explicit overflow policy. The large user domain does not require allocating a record for every user: a <sparse map with a default value> can realize these total <functions>.