Bitwise XOR of Bitwise AND of all pairs from two given arrays | Function to find the Bitwise XOR of Bitwise AND of all pairs from the arrays arr1 [ ] and arr2 [ ] ; Stores XOR of array arr1 [ ] ; Stores XOR of array arr2 [ ] ; Traverse the array arr1 [ ] ; Traverse the array arr2 [ ] ; Return the result ; Driver Code ; Input
def findXORS ( arr1 , arr2 , N , M ) : NEW_LINE INDENT XORS1 = 0 NEW_LINE XORS2 = 0 NEW_LINE for i in range ( N ) : NEW_LINE INDENT XORS1 ^= arr1 [ i ] NEW_LINE DEDENT for i in range ( M ) : NEW_LINE INDENT XORS2 ^= arr2 [ i ] NEW_LINE DEDENT return XORS1 and XORS2 NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT arr1 = [ 1 , 2 , 3 ] NEW_LINE arr2 = [ 6 , 5 ] NEW_LINE N = len ( arr1 ) NEW_LINE M = len ( arr2 ) NEW_LINE print ( findXORS ( arr1 , arr2 , N , M ) ) NEW_LINE DEDENT