You are viewing a single comment's thread. Return to all comments →
I'm a newby but this one made me a bit happy... :)
// Javascript function miniMaxSum(arr) { // Write your code here
// console.log(arr)
let totalArray = [];
for(let i = 0; i < arr.length; i++){
let sum = arr.reduce((acc, e) => acc + e,0) - arr[i]; totalArray.push(sum); //console.log(sum) }
console.log({Math.max(...totalArray)})
{Math.max(...totalArray)}
}
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 →
I'm a newby but this one made me a bit happy... :)
// Javascript function miniMaxSum(arr) { // Write your code here
// console.log(arr)
let totalArray = [];
for(let i = 0; i < arr.length; i++){
console.log(
{Math.max(...totalArray)}
)}