JAVA solution explained in HINDI
https://youtu.be/GYKlcO0sOCo\n\nFor explanation check the video, and please like and subscribe\n\n# Code\n\nclass Solution {\n    public int[] getSumAbsoluteDif
https://youtu.be/GYKlcO0sOCo\n\nFor explanation check the video, and please like and subscribe\n\n# Code\n```\nclass Solution {\n    public int[] getSumAbsoluteDifferences(int[] nums) {\n        int n = nums.length;\n        int totalSum = 0;\n        for (int num : nums) {\n            totalSum += num;\n        }\n        \n        int leftSum = 0;\n        int[] ans = new int[n];\n        for (int i = 0; i < n; i++) {\n            int rightSum = totalSum - leftSum - nums[i];\n            \n            int leftCount = i;\n            int rightCount = n - 1 - i;\n            \n            int leftTotal = leftCount * nums[i] - leftSum;\n            int rightTotal = rightSum - rightCount * nums[i];\n            \n            ans[i] = leftTotal + rightTotal;\n            leftSum += nums[i];\n        }\n        \n        return ans;\n    }\n}\n```
['Java']