Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Simulate an ATM queue where customers withdraw at most k dollars per turn.
Customers who still need money cycle to the back until their balance reaches zero.
Return the 1-based indices of customers in the exact order they finish.
What This Tests
Queue simulation mechanics
Ceiling division and integer math
Stable sorting and tie-breaking logic
Time-space complexity trade-offs
Common Patterns
Sorting
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Report
Report seen similar question in interview
Accepted
1.2k
/1.6k
Acceptance Rate
74.5%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Python3
Auto
Debug
Run
Submit
Test Cases
Input
amounts =
k =
Output
Expected