almost 1 hr utilised java solution
class Solution {\n    public int minimumAverageDifference(int[] nums) {\n        long sum=0;\n        for(int i=0;i<nums.length;i++)\n        {\n            sum
# class Solution {\n    public int minimumAverageDifference(int[] nums) {\n        long sum=0;\n        for(int i=0;i<nums.length;i++)\n        {\n            sum+=nums[i];\n        }\n        long avg=0,rsum=0,lsum=0,min=Integer.MAX_VALUE;\n        int indx=0;\n        int c=1;\n       for(int i=0;i<nums.length-1;i++)\n       {\n           lsum+=nums[i];\n           rsum=(sum-lsum)/((nums.length)-(i+1));\n           avg=Math.abs((lsum/c)-rsum);\n           if(avg<min)\n           {\n               min=avg;\n               indx=i;\n           }\n           c++;\n       }\n        avg=Math.abs(sum/nums.length);\n        if(avg<min)\n        {\n            indx=nums.length-1;\n        }\n        return indx;\n    }\n}
['Prefix Sum', 'Java']