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