check the difference in characters by comparing count arrays
res = 0 NEW_LINE for i in range ( MAX_CHAR ) : NEW_LINE INDENT if ( count1 [ i ] != 0 ) : NEW_LINE INDENT res += abs ( count1 [ i ] - count2 [ i ] ) NEW_LINE DEDENT DEDENT return res NEW_LINE