Amazon Interview Question

Code question on data structures and the topic is stack.