Stripe interview question

Juggling some data structures, but the interviewer kept asking to repeat the process with more complexity