Java Most Possible Solution
\nclass Solution {\n    public int minimumAverageDifference(int[] n) {\n        long sum=0;\n        int i;\n        for(i=0;i<n.length;i++)\n            sum+=n
```\nclass Solution {\n    public int minimumAverageDifference(int[] n) {\n        long sum=0;\n        int i;\n        for(i=0;i<n.length;i++)\n            sum+=n[i];\n        long x=0;;\n        int min=Integer.MAX_VALUE;\n        int result=0;\n        for(i=0;i<n.length;i++){\n            x=x+n[i];\n            sum=sum-n[i];\n            int a=(int)(x/(i+1));\n            int b=(i==n.length-1)?0:(int)(sum/(n.length-i-1));\n            if(Math.abs(a-b) < min){\n                min=Math.abs(a-b);\n                result=i;\n            }\n        }\n        return result;\n    }\n}\n```
['Java']