• + 0 comments

    void miniMaxSum(vector arr) { if(arr.size() == 0) return; sort(arr.begin(), arr.end()); long long int min = accumulate(arr.begin()+0, arr.begin()+4, 0); long long int max = accumulate(arr.begin()+1, arr.begin()+5, 0); cout << min << " " << max; }

    This is the approach I came with but some of the test cases are failing