MCPcopy Create free account
hub / github.com/Hsinha11/Leetcode-solutions / missingNumber

Method missingNumber

268-missing-number/missing-number.py:6–12  ·  view source on GitHub ↗
(self, nums: List[int])

Source from the content-addressed store, hash-verified

4
5class Solution:
6 def missingNumber(self, nums: List[int]) -> int:
7 xor = 0
8 for i in range(len(nums) + 1):
9 xor ^= i
10 for num in nums:
11 xor ^= num
12 return xor

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected