Easy Java Solution || Beginner friendly
Upvote if you like my solution\n\n\nclass Solution {\n    public int[] getSumAbsoluteDifferences(int[] nums) {\n        int rSum = 0;\n        int lSum = 0;\n  
**Upvote if you like my solution**\n\n```\nclass Solution {\n    public int[] getSumAbsoluteDifferences(int[] nums) {\n        int rSum = 0;\n        int lSum = 0;\n        int[] sum = new int[nums.length];\n        for(int i = 0;i<nums.length;i++){\n            rSum += nums[i];\n        }\n        \n        int n = nums.length;\n        int s = 0;\n        for(int i = 0;i<nums.length;i++){\n            rSum -= nums[i];\n            n--;\n            sum[i] = (rSum-n*nums[i]) + (s*nums[i] - lSum);\n            lSum += nums[i];\n            s++;\n            \n        }\n        return sum;\n    }\n}\n```
['Java']