Pregunta de entrevista de Neilsen Industries

Queue question in dsa leetcode medium