human
Count of even set bits between XOR of two arrays | Function that count the XOR of B with all the element in A having even set bit.
Count the set bits in A [ i ].
check for even or Odd.
To store the count of element for B such that XOR with all the element in A having even set bit.
Count set bit for B [ i ].
check for Even or Odd.
Driver Code"
Solution in Python:
 Write me a code to count of even set bits between XOR of two arrays and the other steps required?
assistant
#Here is code to count of even set bits between XOR of two arrays and the other steps required.
 def countEvenBit ( A , B , n , m ) :
	i , j , cntOdd = 0 , 0 , 0
	cntEven = 0
	for i in range ( n ) :
		x = bin ( A [ i ] ) [ 2 : ] . count ( '1' )
		if ( x & 1 ) :
			cntEven += 1
		else :
			cntOdd += 1
	CountB = [ 0 ] * m
	for i in range ( m ) :
		x = bin ( B [ i ] ) [ 2 : ] . count ( '1' )
		if ( x & 1 ) :
			CountB [ i ] = cntEven
		else :
			CountB [ i ] = cntOdd
	for i in range ( m ) :
		print ( CountB [ i ] , end = " ▁ " )
if __name__ == ' _ _ main _ _ ' :
	A = [ 4 , 2 , 15 , 9 , 8 , 8 ]
	B = [ 3 , 4 , 22 ]
	countEvenBit ( A , B , 6 , 3 )