Infosys Interview Question

DSA question about Stacks and queues