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