Infosys interview question

Play with stacks was a question there