```python
def sum_Pairs(arr, n):
    """
    Finds the sum of absolute differences in all pairs of the given array.

    Args:
        arr: A list of numbers.
        n: The number of elements in the array.

    Returns:
        The sum of absolute differences of all pairs.
    """
    # Sort the array. The sum of absolute differences is invariant to the order.
    # After sorting, for any pair (arr[i], arr[j]) with i < j,
    # the absolute difference is arr[j] - arr[i].
    arr.sort()

    # The total sum is Σ |arr[i] - arr[j]| for all 0 <= i < j < n.
    # After sorting, this is Σ (arr[j] - arr[i]) for all 0 <= i < j < n.
    #
    # We can find a more efficient way to calculate this sum than a nested loop.
    # Let's consider the contribution of each element arr[i] to the total sum.
    #
    # For each arr[i]:
    # - It is larger than i elements before it (arr[0] to arr[i-1]).
    #   It will be part of i pairs where it is the larger number.
    #   The sum of differences for these pairs is:
    #   (arr[i] - arr[0]) + (arr[i] - arr[1]) + ... + (arr[i] - arr[i-1])
    #   = i * arr[i] - (arr[0] + arr[1] + ... + arr[i-1])
    #
    # - It is smaller than (n - 1 - i) elements after it (arr[i+1] to arr[n-1]).
    #   It will be part of (n - 1 - i) pairs where it is the smaller number.
    #   The sum of differences for these pairs is:
    #   (arr[i+1] - arr[i]) + (arr[i+2] - arr[i]) + ... + (arr[n-1] - arr[i])
    #   = (arr[i+1] + ... + arr[n-1]) - (n - 1 - i) * arr[i]
    #
    # Combining these, the total coefficient for arr[i] is:
    # It is added i times and subtracted (n - 1 - i) times.
    # So, the coefficient is i - (n - 1 - i) = i - n + 1 + i = 2*i - n + 1.
    #
    # The total sum is Σ (arr[i] * (2*i - n + 1)) for i from 0 to n-1.

    result = 0
    for i in range(n):
        result += arr[i] * (2 * i - n + 1)

    return result
```