Find the number of odd elements . Takes O ( n )
int oddCount = 0 ; char oddChar = 0 ; for ( Entry < Character , Integer > itr : counting . entrySet ( ) ) { if ( itr . getValue ( ) % 2 != 0 ) { oddCount ++ ; oddChar = itr . getKey ( ) ; } }