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: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String str1 = br.readLine();
		String[] str2 = str1.split(" ");
		long[] arr = new long[n];
		for(int i = 0; i < n; ++i) {
			arr[i] = Integer.parseInt(str2[i]);
		}
		long sum1 = arr[0];
		long sum2 = arr[n-1];
		int l = 0;
		int r = n-1;
		while(l < r) {
			if(sum1 < sum2) {
				++l;
				sum1 = sum1 + arr[l];
			} else {
				--r;
				sum2 =  sum2 + arr[r];
			}
		}
		System.out.print(r+1);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?