Counting Sort 1

  • + 0 comments
    function countingSort(arr) {
        // Write your code here
        const arrSample = Array(arr.length).fill(0)
        for(let i in arrSample) {
            arrSample[arr[i]] +=1
        }
        return arrSample.slice(0, 100);
    
    }