Choose X such that ( A xor X ) + ( B xor X ) is minimized | finding X ; finding Sum ; Driver code
def findX ( A , B ) : NEW_LINE INDENT return A & B NEW_LINE DEDENT def findSum ( A , B ) : NEW_LINE INDENT return A ^ B NEW_LINE DEDENT A , B = 2 , 3 NEW_LINE print ( " X ▁ = " , findX ( A , B ) , " , ▁ Sum ▁ = " , findSum ( A , B ) ) NEW_LINE