We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b567ed commit 0fb9825Copy full SHA for 0fb9825
1 file changed
bit/find_missing_number.py
@@ -1,7 +1,7 @@
1
def find_missing_number(nums):
2
"""Returns the missing number from a sorted sequence of integers
3
in O(n) time and space.
4
-
+
5
>>> find_missing(i for i in range(-2000, 10000) if i != 1234)
6
1234
7
"""
@@ -18,4 +18,5 @@ def find_missing_number(nums):
18
if num != 0:
19
missing ^= num
20
missing ^= i + 1
21
22
return missing
0 commit comments