input: Write a python function to sort an array using quick sort.
  assert quick_sort([7, 3, 8, 4, 10, 1]) == [1, 3, 4, 7, 8, 10]
  assert quick_sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]
  assert quick_sort([12, 4, 5, 6, 7, 3, 1, 15]) == [1, 3, 4, 5, 6, 7, 12, 15]
output: def quick_sort(arr):
      if len(arr) <= 1:
          return arr
      pivot = arr[len(arr) // 2]
      left = [x for x in arr if x < pivot]
      middle = [x for x in arr if x == pivot]
      right = [x for x in arr if x > pivot]
      return quick_sort(left) + middle + quick_sort(right)