class Solution:
def missingNumber(self, nums: List[int]) -> int:
n=len(nums)+1
mottoSum=(n-1)*n/2
return int(mottoSum-sum(nums))
LeetCode:268. 缺失数字
猜你喜欢
转载自blog.csdn.net/dosdiosas_/article/details/106267814
今日推荐
周排行