You are viewing a single comment's thread. Return to all comments →
def balancedSums(arr): n = len(arr) start_index = 0 left_sum = 0 right_sum = sum(arr[start_index+1:]) for i in range(start_index, n): if i != 0: left_sum += arr[i-1] right_sum -= arr[i] if left_sum == right_sum: 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 →