Amazon Interview Question

implement min stack write and explain the code for it