Perform XOR operation on each bit
for ( var i = 0 ; i < max_len ; i ++ ) { var pres_bit = 0 ; for ( var j = 0 ; j < n ; j ++ ) pres_bit = pres_bit ^ ( arr [ j ] [ i ] - ' ' . charCodeAt ( 0 ) ) ; result += ( pres_bit + ' ' . charCodeAt ( 0 ) ) ; }