Lumis interview question

Algoritmo de fila