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.
functionjimOrders(orders){// Write your code hereletobj={};for(leti=0;i<orders.length;){lettemp=orders[i][0]+orders[i][1];i++;obj[i]=temp;}letreciveArr=[];for(letelminobj){reciveArr.push([elm,obj[elm]]);}reciveArr.sort((a,b)=>a[1]-b[1]);for(leti=0;i<reciveArr.length;i++){reciveArr[i]=+reciveArr[i][0]}returnreciveArr;}
Jim and the Orders
You are viewing a single comment's thread. Return to all comments →
JS solution