You are viewing a single comment's thread. Return to all comments →
C++ Code:
void miniMaxSum(vector<int> arr) { long min=1e9, max=0; for (int i : arr) { if (i<min) min = i; if (i>max) max = i; } long sum=0; for (int i : arr) sum += i; cout << 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 →
C++ Code: