2425. Bitwise XOR of All Pairings

1 min read

class Solution:
def xorAllNums(self, num1: List[int], num2: List[int]) -> int:
l1 = len(num1)
l2 = len(num2)
c1 = l1 % 2
c2 = l2 % 2
ans = 0
x = []
if c1:
x += num2
if c2:
x += num1
for e in x:
ans ^= e
return ans
0
Subscribe to my newsletter
Read articles from Tapan Rachchh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
