Count pairs with Bitwise AND as ODD number | Python program to count pairs with Odd AND ; Count total odd numbers ; return count of even pair ; Driver Code ; calling function findOddPair and print number of odd pair
def findOddPair ( A , N ) : NEW_LINE INDENT count = 0 ; NEW_LINE for i in range ( 0 , N - 1 ) : NEW_LINE INDENT if ( ( A [ i ] % 2 == 1 ) ) : NEW_LINE INDENT count = count + 1 NEW_LINE DEDENT DEDENT return count * ( count - 1 ) / 2 NEW_LINE DEDENT a = [ 5 , 1 , 3 , 2 ] NEW_LINE n = len ( a ) NEW_LINE print ( int ( findOddPair ( a , n ) ) ) NEW_LINE