1
2
3
4
|
class Solution:
def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
n=len(nums)
return set(range(1,n+1))-set(nums)
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 896. Monotonic Array (0) | 2022.03.28 |
---|---|
leetcode 1185. Day of the Week (0) | 2022.03.28 |
Leetcode 268. Missing Number (0) | 2022.03.28 |
leetcode 2129. Capitalize the Title (0) | 2022.03.25 |
leetcode 217. Contains Duplicate (0) | 2022.03.24 |
댓글