title: Difference Maximum Sum Minimum Sum N M Elementsin Review
signature: function differenceMaximumSumMinimumSumNMElementsinReview(arr, n, m) {
source_py: def difference_maximum_sum_minimum_sum_n_m_elementsin_review(arr, n, m):
      max = 0
      min = 0
      arr.sort()
      j = (n - 1)
      for i in range(m):
          min += arr[i]
          max += arr[j]
          j = (j - 1)
      return (max - min)
source_cpp: int difference_maximum_sum_minimum_sum_n_m_elementsin_review(vector<int> arr, int n, int m) {
    int max = 0, min = 0;
    sort(arr.begin(), arr.end());
    for ( int i = 0, j = n - 1;
    i < m;
    i ++, j -- ) {
      min += arr [ i ];
      max += arr [ j ];
    }
    return ( max - min );
  }