If m [ a + b ] = c , then add c to the current sum .
if ( ( prefix_sum [ i ] + 1 ) in m ) : NEW_LINE INDENT sum += m [ prefix_sum [ i ] + 1 ] NEW_LINE DEDENT if ( ( prefix_sum [ i ] - 1 ) in m ) : NEW_LINE INDENT sum += m [ prefix_sum [ i ] - 1 ] NEW_LINE DEDENT