# Online Python compiler (interpreter) to run Python online.
# Write Python 3 code in this online editor and run it.
arr = [42, 17, 93, 58, 26, 71, 11, 39, 84, 6]
#Quick sort
#pick pivot now its middle
def qk_sort(arr):
if len(arr) <= 1:
return arr
n = len(arr)
pivot = arr[n//2] #mid
left_part = [x for x in arr if x < pivot]
middle_part = [x for x in arr if x == pivot]
right_part = [x for x in arr if x > pivot ]
return qk_sort(left_part) + middle_part + qk_sort(right_part)
print(qk_sort(arr))