Meta Interview Question

Monotonous stack and a BFS problem