Sum of Absolute Differences in a Sorted Array
For each index in a sorted array, compute the total of absolute differences to every other value. The visual splits the array into left and right parts and tracks the running prefix sums.
For each index in a sorted array, compute the total of absolute differences to every other value. The visual splits the array into left and right parts and tracks the running prefix sums.