TRM Labs interview question

Resolve a technical problem using queues. Code correction online.