ATM Queue
Asked at Squarepoint · Coding Questions · Difficulty: Medium · Last asked Jul 15, 2026
Given an ATM queue, input the amount of money each person wants to withdraw and the maximum amount the ATM can allow in one transaction. Calculate the order of people leaving the queue. All people withdraw money in sequence; if anyone's required amount exceeds the current limit of the ATM, they need to rejoin the end of the queue until they have withdrawn enough money. The output should be an array representing the order in which each person leaves the queue.
Loading the problem…