Springboard Interview Question

Stack based question