If all characters are present even number of times or all are present odd number of times .
if ( ( $ count [ 0 ] % 2 ) == ( $ count [ 1 ] % 2 ) && ( $ count [ 1 ] % 2 ) == ( $ count [ 2 ] % 2 ) ) return 2 ;