Insert the last character block
if ( ( S [ ( len ( S ) - 1 ) ] != S [ ( len ( S ) - 2 ) ] ) or insert == False ) : NEW_LINE INDENT sorted1 . append ( curr ) NEW_LINE original . append ( curr ) NEW_LINE DEDENT