You are viewing a single comment's thread. Return to all comments →
let minValue = Infinity; let maxValue = -Infinity; let total = 0; for (let i = 0; i < arr.length; i++) { if (minValue > arr[i]) minValue = arr[i] if (maxValue < arr[i]) maxValue = arr[i] total+= arr[i]; } console.log(total - maxValue, total - minValue)
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 →