For this Question: Given an array of size N, find the index which partitions the arrays into 2 subarrays such that absolute difference of their sums is minimized.

If we partition with respect to index i (1<=i<=N) subarrays will be:-  (A1,A2,A3.....Ai-1) , (Ai+1,Ai+2,......An)First line of input contains the size of array N, next line contains N space separated integers depicting the values of array.

<b>Constraint</b>
1<=N<=10^5
1<=Arr[i]<=10^7
Print the index for minimum absolute difference. If more than one answer exists print the minimum index.Sample input:-
4
1 2 3 4 


Sample output:-
3

Explanation:-
For index 1 absolute difference = 2 + 3 + 4 = 9
For index 2 absolute difference = 3 + 4 - 1 = 6
For index 3 absolute difference = 4 - 1 - 2 = 1
For index 4 absolute difference = 1 + 2 + 3 = 6, I have written this Solution Code: 'use strict'

function Main(input)
{
    const inputList = input.split('\n');
    const arrSize = Number(inputList[0].split(' ')[0])
    const arr = inputList[1].split(' ').
                    map(x => Number(x))

       var res = minAbsDiff(arr, arrSize)
    console.log(res)


}
function minAbsDiff(arr, arrSize)
{
  var sum = 0
  var list = new Array(arrSize)
  for(var i = 0; i < arrSize; i++)
  {
    sum += arr[i]
    list[i] = sum
  }
   var res = 9223372036854775807 
   var pre = 0
   var cnt = 0
   
     
   for(var i=0;i<arrSize;i++){
          if(Math.abs(sum-list[i]-pre)<res)
          {
            res=Math.abs(sum-list[i]-pre)
            cnt=i
            
          }
          pre+=arr[i]


   }
   
   return (cnt+1)
   
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?