Amazon Interview Question

Sort 0,1,2 in optimize that is O(n) complexity.