You are viewing a single comment's thread. Return to all comments →
Javascript solution:
function miniMaxSum(arr) { const sum = arr.reduce((accumulator, currentValue) => { return accumulator + currentValue },0);
const min = sum - Math.max(...arr) const max = sum - Math.min(...arr) 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 →
Javascript solution:
function miniMaxSum(arr) { const sum = arr.reduce((accumulator, currentValue) => { return accumulator + currentValue },0);
}