decrease the count of character updated
if R [ i ] in cnt : NEW_LINE INDENT cnt [ R [ i ] ] -= 1 NEW_LINE DEDENT else : NEW_LINE INDENT cnt [ R [ i ] ] = - 1 NEW_LINE DEDENT R [ i ] = R [ j ] NEW_LINE if R [ j ] in cnt : NEW_LINE INDENT cnt [ R [ j ] ] += 1 NEW_LINE DEDENT else : NEW_LINE INDENT cnt [ R [ j ] ] = 1 NEW_LINE DEDENT j += 1 NEW_LINE