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.
functionquickSort(arr){// Write your code hereletequal=arr[0]letleft=[]letright=[]for(leti=1;i<arr.length;i++){if(arr[i]>equal){right.push(arr[i])}else{left.push(arr[i])}}return[...left,equal,...right]}
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 →
javascript