题目:
题解:
class Solution:
def missingNumber(self, nums: List[int]) -> int:
n = len(nums)
total = n * (n + 1) // 2
arrSum = sum(nums)
return total - arrSum
题目:
题解:
class Solution:
def missingNumber(self, nums: List[int]) -> int:
n = len(nums)
total = n * (n + 1) // 2
arrSum = sum(nums)
return total - arrSum