Amazon interview question

Implement sort using list