Amazon Interview Question

Implement sort using list