You are viewing a single comment's thread. Return to all comments →
C#
public static string balancedSums(List arr) {
int sumLeft = 0; int sumRight = arr.Skip(1).Sum(); for(int i = 0; i < arr.Count; i++) { if(i>0) { sumLeft += arr[i - 1]; sumRight -= arr[i]; } if(sumLeft == sumRight) { return "YES"; } } 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 →
C#
public static string balancedSums(List arr) {