Easy JAVA Solution
Approach\n    Basic approach\n\n# Complexity\n- Time complexity:\n    O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:\n    O(1) Add your
# Approach\n    Basic approach\n\n# Complexity\n- Time complexity:\n    O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n    O(1)<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minimumAverageDifference(int[] n) {\n        long sume=0;\n        int i;\n        for(i=0;i<n.length;i++)\n            sume+=n[i];\n        long sums=0;;\n        int min=Integer.MAX_VALUE;\n        int ind=0;\n        for(i=0;i<n.length;i++){\n            sums=sums+n[i];\n            sume=sume-n[i];\n            int a=(int)(sums/(i+1));\n            int b=(i==n.length-1)?0:(int)(sume/(n.length-i-1));\n            if(Math.abs(a-b) < min){\n                min=Math.abs(a-b);\n                ind=i;\n            }\n        }\n        return ind;\n    }\n}\n```
['Java']