You are viewing a single comment's thread. Return to all 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)) ); }
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Sort 1
You are viewing a single comment's thread. Return to all 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)) ); }