Pregunta de entrevista de TRM Labs

Resolve a technical problem using queues. Code correction online.