You are viewing a single comment's thread. Return to all comments →
Python:
def balancedSums(arr): leftSum = 0 rightSum = sum(arr) n = len(arr) if n == 1: return "YES" for i in range(n): rightSum -= arr[i] if rightSum == leftSum: return "YES" leftSum += arr[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 →
Python: