You are viewing a single comment's thread. Return to all comments →
javascript
function sum(x, y) { return Number(x) + Number(y); } function main() { var a_temp = readLine().split(' '); const sorted = a_temp.sort(); const min = sorted.slice(0, 4).reduce(sum, 0); const max = sorted.slice(1, 5).reduce(sum, 0); console.log(min, max); }
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
javascript