You are viewing a single comment's thread. Return to all comments →
Nice. I went for nothing more than sort and because it's a small array, manual log:
sort
function main() { const arr = readLine().split(' ').map(arrTemp => parseInt(arrTemp, 10)); arr.sort(); console.log((arr[0]+arr[1]+arr[2]+arr[3])+' '+(arr[1]+arr[2]+arr[3]+arr[4])); }
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 →
Nice. I went for nothing more than
sort
and because it's a small array, manual log: