You are viewing a single comment's thread. Return to all comments →
arr.sort((a, b)=> a-b) let min=0; let max =0; for(let i=0; i<4;i++){ min += arr[i]; } for(let i=1; i<=4;i++){ max += arr[i] }
console.log(min, max);
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →