Springboard interview question

Stack based question