input: Write a python function to calculate the sum of absolute differences between all pairs of elements in an array.
  assert sum_absolute_differences([5, 8, 10, 15]) == 100
  assert sum_absolute_differences([1, 2, 3]) == 8
  assert sum_absolute_differences([0, 0, 0]) == 0
output: def sum_absolute_differences(arr):
      total_sum = 0
      for i in range(len(arr)):
          for j in range(i+1, len(arr)):
              total_sum += abs(arr[i] - arr[j])
      return total_sum * 2