You are viewing a single comment's thread. Return to all comments →
Typescript:
let sum = 0; let minVal = Infinity; let maxVal = 0; for (let i of arr) { sum += i; if (i < minVal) minVal = i; if (i > maxVal) maxVal = i; } console.log(sum - maxVal, sum - minVal);
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 →
Typescript: