言诗把酒

关注

Leetcode 268. 丢失的数字

言诗把酒

关注

阅读 52

2022-01-09

268. 丢失的数字

Code

class Solution:
    def missingNumber(self, nums: List[int]) -> int:
        length = len(nums)
        nums.sort()
        for i in range(length):
            if nums[i] != i:
                return i
        return length

相关推荐

非常帅气的昵称吧

【LeetCode】268. 丢失的数字

非常帅气的昵称吧 43 0 0

书呆鱼

268. 丢失的数字

书呆鱼 37 0 0

朱悟能_9ad4

LeetCode Algorithm 268. 丢失的数字

朱悟能_9ad4 60 0 0

Aliven888

268. 丢失的数字 (Python 实现)

Aliven888 31 0 0

心存浪漫

【Leetcode 每日一题】268. 丢失的数字

心存浪漫 24 0 0

夏木之下

【力扣】268.丢失的数字

夏木之下 7 0 0

干自闭

LeetCode#268. 丢失的数字

干自闭 33 0 0

E_topia

LeetCode-268-丢失的数字

E_topia 34 0 0

斗米

LeetCode 268. Missing Number

斗米 76 0 0

月白色的大狒

leetcode268 丢失的数字

月白色的大狒 16 0 0

精彩评论(0)

0 0 举报