For this Question: You are given an array A of size N. Find the number of indexes i (1 <= i <= N) such that the sum of the elements to its right is atmost equal to the sum of elements to its left.The first line of input contains N, the size of the array.
The second line of input contains N space seperated integers A<sub>i</sub>.

Constraints:
1 <= N <= 10<sup>5</sup>
-10<sup>9</sup> <= A<sub>i</sub> <= 10<sup>9</sup>Print the number of indexes i (1 <= i <= N) such that the sum of the elements to its right is atmost equal to the sum of elements to its left.Sample Input:
5
3 -2 4 -1 4

Sample Output:
2, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args)throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        StringTokenizer st = new StringTokenizer(br.readLine());
        long arr[] = new long[n];
        long pre[] =new long[n];
        long sum=0;
        for(int i=0; i<n; i++){
            arr[i] = Integer.parseInt(st.nextToken());
            sum+=arr[i];
            pre[i]=sum;
        }

          int cnt=0;
        for(int i=0;i<pre.length;i++){
            if(i==0){
                if(0>=(pre[pre.length-1]-pre[i]))cnt++;

                continue;
            }else if(i==pre.length-1){
                if(pre[pre.length-2]>=0)cnt++;


                continue;
            }
            if(pre[i-1]>=(pre[pre.length-1]-pre[i])){
              cnt++;
            }
        }

         System.out.print(cnt);

    }
}













































        , In this Programming Language: Java, Now tell me if this Code is compilable or not?