Domanda di colloquio di Daisy Group

The leetcode question on stack and queue