You are viewing a single comment's thread. Return to all comments →
public static String balancedSums(List<Integer> arr) { int leftArr = 0; int rightArr = 0; for (Integer integer : arr) { leftArr+=integer; } for (Integer i : arr) { leftArr -= i; if (leftArr == rightArr) return "YES"; rightArr += i; } return "NO"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Array
You are viewing a single comment's thread. Return to all comments →