If S [ i ] and T [ i ] have different parities
if ( ( value [ S . charAt ( i ) - ' a ' ] % 2 == 0 && value [ T . charAt ( i ) - ' a ' ] % 2 == 1 ) || ( value [ S . charAt ( i ) - ' a ' ] % 2 == 1 && value [ T . charAt ( i ) - ' a ' ] % 2 == 0 ) ) flag = false ; }