Count number of ways to split array at index i such that subarray sums are same
y , z = 0 , 0 NEW_LINE if - diff // 2 in suffixCount : NEW_LINE INDENT y = suffixCount [ - dff // 2 ] NEW_LINE DEDENT if diff // 2 in prefixCount : NEW_LINE INDENT z = prefixCount NEW_LINE DEDENT x = z + y NEW_LINE