@@ -0,0 +1,1657 @@
+import java.io.*;%0Aimport java.math.*;%0Aimport java.security.*;%0Aimport java.text.*;%0Aimport java.util.*;%0Aimport java.util.concurrent.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    // Complete the balancedSums function below.%0A    static String balancedSums(List%3CInteger%3E arr) %7B%0A        int%5B%5D arr_new = new int%5Barr.size()%5D;%0A        int tsum = 0;%0A        for(int i=0;i%3Carr.size();i++)%7B%0A            arr_new%5Bi%5D=arr.get(i);%0A            tsum+=arr_new%5Bi%5D;%0A        %7D %0A        int prev = 0;%0A        int next = tsum;%0A        for(int i=0;i%3Carr.size();i++)%7B%0A            next-=arr_new%5Bi%5D;%0A            if(prev==next) return %22YES%22;%0A            prev+=arr_new%5Bi%5D;%0A        %7D%0A        return %22NO%22;%0A    %7D%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));%0A        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv(%22OUTPUT_PATH%22)));%0A%0A        int T = Integer.parseInt(bufferedReader.readLine().trim());%0A%0A        for (int TItr = 0; TItr %3C T; TItr++) %7B%0A            int n = Integer.parseInt(bufferedReader.readLine().trim());%0A%0A            String%5B%5D arrItems = bufferedReader.readLine().replaceAll(%22%5C%5Cs+$%22, %22%22).split(%22 %22);%0A%0A            List%3CInteger%3E arr = new ArrayList%3C%3E();%0A%0A            for (int i = 0; i %3C n; i++) %7B%0A                int arrItem = Integer.parseInt(arrItems%5Bi%5D);%0A                arr.add(arrItem);%0A            %7D%0A%0A            String result = balancedSums(arr);%0A%0A            bufferedWriter.write(result);%0A            bufferedWriter.newLine();%0A        %7D%0A%0A        bufferedReader.close();%0A        bufferedWriter.close();%0A    %7D%0A%7D%0A

add SherlockAndArray.java