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 ; Input
function findXORS ( arr1 , arr2 , N , M ) { let XORS1 = 0 ; let XORS2 = 0 ; for ( let i = 0 ; i < N ; i ++ ) { XORS1 ^= arr1 [ i ] ; } for ( let i = 0 ; i < M ; i ++ ) { XORS2 ^= arr2 [ i ] ; } return XORS1 && XORS2 ; } let arr1 = [ 1 , 2 , 3 ] ; let arr2 = [ 6 , 5 ] ; let N = arr1 . length ; let M = arr2 . length ; document . write ( findXORS ( arr1 , arr2 , N , M ) ) ;