Easy
long long int n=nums.size();\n        long long int presum[n];\n        presum[0]=nums[0];\n        for(int i=1;i=0;i--)\n        {\n            sufsum[i]=sufsu
long long int n=nums.size();\n        long long int presum[n];\n        presum[0]=nums[0];\n        for(int i=1;i<n;i++)\n        {\n            presum[i]=presum[i-1]+nums[i];\n        }\n        \n   long long sufsum[n];\n        sufsum[n-1]=nums[n-1];\n        for(int i=n-2;i>=0;i--)\n        {\n            sufsum[i]=sufsum[i+1]+nums[i];\n        }\n        \n      long long  mini=INT_MAX;\n       long long int ans=0;\n       for(int i=0;i<n;i++)\n       {\n           long long int x,y;\n           if(i==n-1)\n           {\n               \n           \n          x=presum[i]/(i+1);\n           \n                y=0;\n\n           }\n           else\n           {\n               \n               x=presum[i]/(i+1);\n           \n                 y=sufsum[i+1]/(n-i-1);\n               \n           }\n           \n          \n           \n           if(abs(x-y)<mini)\n           {\n               mini=abs(x-y);\n               ans=i;\n           }\n       }\n        \n       \n        return ans;
['C', 'Prefix Sum']