Oracle interview question

ATM machine algorithm (Leetcode Medium)