Tripadvisor interview question

Sort with only stacks