You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, explanation here : https://youtu.be/zcWbM-aaopc
#include <bits/stdc++.h> using namespace std; int main() { vector<int> arr(5); for(int i = 0; i < 5; i++) { cin >> arr[i]; } auto min_max = minmax_element(arr.begin(), arr.end()); long long su = 0; su = accumulate(arr.begin(), arr.end(), su); cout << su - *min_max.second << " " << su - *min_max.first; return 0; }
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 →
Here is my c++ solution, explanation here : https://youtu.be/zcWbM-aaopc