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