You are viewing a single comment's thread. Return to all comments →
void miniMaxSum(vector<int> arr) { sort(arr.begin(),arr.end()); long sum1 = 0; long sum2 = 0; for (int i=0;i<5;i++){ if (i<4) sum1 += arr[i]; if (i>0) sum2 += arr[i]; } cout <<sum1 << " " << sum2; }
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 →