<<BEAT 100% SOLUTIONS || EASY THAN YOUR EXPECTATIONS>>
PLEASE UPVOTE MECode
# PLEASE UPVOTE ME
# Code
```cpp []
class Solution {
public:
    vector<int> getSumAbsoluteDifferences(vector<int>& nums) {
        vector<int> ans;
        int a=0,b=0;
        for(int i:nums) a+=i;
        for(int i=0;i<nums.size();i++){
            int c=((i*nums[i])-b)+((a-nums[i])-((nums.size()-i-1)*nums[i]));
            ans.push_back(c);
            b+=nums[i];
            a-=nums[i];}
        return ans;}};
```
['C++']