Quick Sort Optimized

Deal with duplicate elements