title: Maximize Sum Consecutive Differences Circular Array
signature: function maximizeSumConsecutiveDifferencesCircularArray($arr, $n) {
source_py: def maximize_sum_consecutive_differences_circular_array(arr, n):
      sum = 0
      arr.sort()
      for i in range(0, int((n / 2))):
          sum -= (2 * arr[i])
          sum += (2 * arr[((n - i) - 1)])
      return sum
source_cpp: int maximize_sum_consecutive_differences_circular_array(vector<int> arr, int n) {
    int sum = 0;
    sort(arr.begin(), arr.end());
    for ( int i = 0;
    i < n / 2;
    i ++ ) {
      sum -= ( 2 * arr [ i ] );
      sum += ( 2 * arr [ n - i - 1 ] );
    }
    return sum;
  }