diff --git a/Sorts/CountingSort.js b/Sorts/CountingSort.js index cc2dd18e5..86389b720 100644 --- a/Sorts/CountingSort.js +++ b/Sorts/CountingSort.js @@ -28,9 +28,7 @@ const countingSort = (arr, min, max) => { res[count[arr[i] - min]] = arr[i] count[arr[i] - min]-- } - // Copy the result back to back to original array - arr = [...res] - return arr + return res } /**