Pregunta de entrevista de Intel Corporation

Coding question regarding to the list pop/stack question.