We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functioncountSort(arr:string[][]):void{// create converted arr, fill with []letarr_converted=Array.from({length:arr.length},()=>[]);// forech element in [arr], add to [arr_converted]for(leti=0;i<arr.length;i++){letn=Number(arr[i][0])letc=i+1<=arr.length/2?'-':arr[i][1]arr_converted[n].push(c)}// printconsole.log(arr_converted.flat().join(' ').trim())}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Full Counting Sort
You are viewing a single comment's thread. Return to all comments →
My answer in Typescript, noted