- 풀이 날짜 :
2021-06-13
- 풀이 소요 시간 :
5m
- LeetCode URL : https://leetcode.com/problems/contains-duplicate/
def containsDuplicate(nums: List[int]) -> bool:
num_dict = dict()
for num in nums :
if num in num_dict :
num_dict[num] += 1
else :
num_dict[num] = 1
if len(num_dict.keys()) == len(nums) :
return False
else :
return True