Stores the sorted string
char [ ] sorted_s = s . toString ( ) . toCharArray ( ) ; Arrays . sort ( sorted_s ) ; reverse ( sorted_s ) ; for ( int i = 0 ; i < len ; ++ i ) { if ( s . charAt ( i ) != sorted_s [ i ] ) {