If this is true then this character is being visited for the first time from the last Thus last occurrence of this character is stored in this index
loccur [ chI ] = i ; NEW_LINE sorted_s = s ; NEW_LINE sorted_s . sort ( ) ; NEW_LINE for i in range ( length ) : NEW_LINE if ( s [ i ] != sorted_s [ i ] ) : NEW_LINE