human
Count of pairs in an array such that the highest power of 2 that divides their product is 1 | Function to return the count of valid pairs.
To store the count of odd numbers and the count of even numbers such that 2 is the only even factor of that number.
If current number is odd.
If current number is even and 2 is the only even factor of it.
Calculate total number of valid pairs.
Driver code"
Solution in Python:

=====
Write me a code to count of pairs in an array such that the highest power of 2 that divides their product is 1 and the other steps required?
assistant
#Here is code to count of pairs in an array such that the highest power of 2 that divides their product is 1 and the other steps required.
 def cntPairs ( a , n ) :
	odd = 0 ; even = 0 ;
	for i in range ( n ) :
		if ( a [ i ] % 2 == 1 ) :
			odd += 1 ;
		elif ( ( a [ i ] / 2 ) % 2 == 1 ) :
			even += 1 ;
	ans = odd * even + ( odd * ( odd - 1 ) ) // 2 ;
	return ans ;
if __name__ == " _ _ main _ _ " :
	a = [ 4 , 2 , 7 , 11 , 14 , 15 , 18 ] ;
	n = len ( a ) ;
	print ( cntPairs ( a , n ) ) ;