class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
hashmap = {}
for num in nums:
if num not in hashmap:
hashmap[num]=1
else:
hashmap[num] += 1
return True
return False
'LeetCode > 주제별 보충' 카테고리의 다른 글
BST: 278. First Bad Version (0) | 2025.01.21 |
---|---|
BST: 704. Binary Search (0) | 2025.01.21 |
Heap-PrioiryQueue: 621. Task Scheduler ★★★ (0) | 2025.01.20 |
Heap-PrioiryQueue: 215. Kth Largest Element in an Array ★ (0) | 2025.01.20 |
Heap-PrioiryQueue: 973. K Closest Points to Origin ★ (0) | 2025.01.20 |