LinkedIn interview question

Given a stack, sort it.