Declaration and initialization of counter array
int counter1 [ MAX ] ; int counter2 [ MAX ] ; memset ( counter1 , 0 , sizeof ( counter1 ) ) ; memset ( counter2 , 0 , sizeof ( counter2 ) ) ; for ( int i = 0 ; i < l / 2 ; i ++ ) counter1 [ str [ i ] - ' a ' ] ++ ; for ( int i = l / 2 ; i < l ; i ++ ) counter2 [ str [ i ] - ' a ' ] ++ ; for ( int i = 0 ; i < MAX ; i ++ ) if ( counter2 [ i ] != counter1 [ i ] ) return true ; return false ; }