Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 11fbfb1

Browse files
Create 2425.py
1 parent 0a20eb9 commit 11fbfb1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎2401-2500/2425.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def xorAllNums(self, nums1, nums2):
3+
c1 = len(nums1)
4+
c2 = len(nums2)
5+
x1 = 0
6+
x2 = 0
7+
if c1 % 2 != 0:
8+
for i in nums2:
9+
x2 ^= i
10+
if c2 % 2 != 0:
11+
for i in nums1:
12+
x1 ^= i
13+
return x1 ^ x2

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /