LeetCode 筆記 - 268. Missing Number Posted on 2022-06-12題目在此 268. Missing Number給定一個連續數列但缺少一個數字,請找出缺少的數字為何解題思維排序之後,掃過一次程式碼12345678910class Solution: def missingNumber(self, nums: List[int]) -> int: size = len(nums) nums.sort() for i in range(size): if nums[i] != i: return i return size也許你也會想看看LeetCode 筆記 - 509. Fibonacci NumberLeetCode 筆記 - 283. Move ZeroesLeetCode 筆記 - 1641. Count Sorted Vowel Strings