Amazon interview question

implement min stack write and explain the code for it