Stacks and queues

Last in first out, first in first out, and a favourite interview question.

A stack gives back the newest item, like a pile of plates. A queue gives back the oldest, like a ticket line. In Python, use a list for a stack and collections.deque for a queue.

Expected output
first
3

Balanced brackets

Expected output
True
False
โ† Arrays and two pointersLinked lists โ†’