Counting Sort 1

  • + 0 comments

    JS Solution:

    function countingSort(arr) { return Object.values( arr.reduce((acc, cur) => { acc[cur] = (acc[cur] || 0) + 1; return acc; }, new Array(100).fill(0)) ); }