functionquickSort(arr){quickSortHelper(arr,0,arr.length-1);returnarr;}functionpartition(arr,s,e){letpointer=s;letleft=s;while (left<e) {if (arr[left] <arr[e]) {swap(arr,left,pointer);pointer++;}left++;}swap(arr,pointer,e);returnpointer;}functionquickSortHelper(arr,s,e){if (s>=e) {return;}constpivotIndex=partition(arr,s,e);constleft=quickSortHelper(arr,s,pivotIndex-1);constright=quickSortHelper(arr,pivotIndex+1,e);}functionswap(arr,a,b){ [arr[b],arr[a]] = [arr[a],arr[b]];}// Do not edit the line below.exports.quickSort=quickSort;