LTIMindtree interview question

Basic stack and arrays questions