We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8ef9d6 commit 1dcc928Copy full SHA for 1dcc928
0268-missing-number/0268-missing-number.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def missingNumber(self, nums: List[int]) -> int:
3
+ xor1=0
4
+ xor2=0
5
+ n=len(nums)
6
+ for i in range(n):
7
+ xor1^=nums[i]
8
+ xor2^=i+1
9
+ return xor1^xor2
0 commit comments