human
Given two arrays count all pairs whose sum is an odd number | Function that returns the number of pairs.
Count of odd and even numbers.
Traverse in the first array and count the number of odd and evene numbers in them.
Traverse in the second array and count the number of odd and evene numbers in them.
Count the number of pairs.
Return the number of pairs.
Driver code"
Solution in Python:

Write me a code to given two arrays count all pairs whose sum is an odd number and the other steps required?
assistant
#Here is code to given two arrays count all pairs whose sum is an odd number and the other steps required.
 def count_pairs ( a , b , n , m ) :
	odd1 = 0
	even1 = 0
	odd2 = 0
	even2 = 0
	for i in range ( n ) :
		if ( a [ i ] % 2 ) :
			odd1 += 1
		else :
			even1 += 1
	for i in range ( m ) :
		if ( b [ i ] % 2 ) :
			odd2 += 1
		else :
			even2 += 1
	pairs = ( min ( odd1 , even2 ) + min ( odd2 , even1 ) )
	return pairs
if __name__ == ' _ _ main _ _ ' :
	a = [ 9 , 14 , 6 , 2 , 11 ]
	b = [ 8 , 4 , 7 , 20 ]
	n = len ( a )
	m = len ( b )
	print ( count_pairs ( a , b , n , m ) )