Otherwise , update the vector
else : NEW_LINE INDENT if ( sum != 0 ) : NEW_LINE INDENT res . append ( sum ) NEW_LINE DEDENT sum = 0 NEW_LINE res . append ( arr [ i ] ) NEW_LINE DEDENT if ( sum != 0 ) : NEW_LINE res . append ( sum ) NEW_LINE