Capital One interview question

Simple leetcode-style problem about bank transactions simulation.