Question d’entretien chez Google

simple algorithm question about ques and stacks