Quantiphi interview question

implement the stack