Capgemini interview question

stack program and done