Count the number of removals required for current character
for index in mp [ x ] : NEW_LINE INDENT if ( first ) : NEW_LINE INDENT if ( index > 0 ) : NEW_LINE INDENT curr += 1 ; NEW_LINE DEDENT prev = index ; NEW_LINE first = False ; NEW_LINE DEDENT else : NEW_LINE INDENT if ( index != prev + 1 ) : NEW_LINE INDENT curr += 1 ; NEW_LINE DEDENT prev = index ; NEW_LINE DEDENT DEDENT if ( prev != n - 1 ) : NEW_LINE INDENT curr += 1 ; NEW_LINE DEDENT