AlphaStream interview question

Stack sorting using temporary stack