You are viewing a single comment's thread. Return to all comments →
Java
int totalSum = 0; int leftSum = 0; for (int num : arr) { totalSum += num; } for (int i = 0; i < arr.size(); i++) { if (leftSum == totalSum - leftSum - arr.get(i)) { return "YES"; } leftSum += arr.get(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 →
Java