Cisco Interview Question

That brackets problem which you solve using stack.