bitvector to store the record of which character appear odd and even number of times
int bitvector = 0 , mask = 0 ; for ( int i = 0 ; a [ i ] != ' \0' ; i ++ ) { int x = a [ i ] - ' a ' ; mask = 1 << x ; bitvector = bitvector ^ mask ; } return ( bitvector & ( bitvector - 1 ) ) == 0 ; }