We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 782fa52 + 2db92c8 commit e295379Copy full SHA for e295379
1 file changed
Python/missing-number.py
@@ -20,3 +20,7 @@ def missingNumber(self, nums):
20
"""
21
return reduce(operator.xor, nums, \
22
reduce(operator.xor, xrange(len(nums) + 1)))
23
+
24
+class Solution2(object):
25
+ def missingNumber(self, nums):
26
+ return sum([i for i in xrange(len(nums)+1)])-sum(nums)
0 commit comments