We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
left = []
right = []
equal = [arr[0]]
for i in range(1,len(arr)):
if arr[i] > arr[0]:
right.append(arr[i])
else:
left.append(arr[i])
x = left + equal + right
return x
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Quicksort 1 - Partition
You are viewing a single comment's thread. Return to all comments →
python3: