Frequency array to store the frequency of each of the character of the current string
int [ ] num = new int [ 26 ] ; for ( int j = 0 ; j < st . length ( ) ; j ++ ) num [ st . charAt ( j ) - ' a ' ] ++ ; boolean flag = true ;