solve quicksort