Day 13 Task:
- Contains Duplicate: https://leetcode.com/problems/contains-duplicate/
Solution:
Please review all the solutions and try implementing on your own if you haven’t gotten it.
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
ht= {}
for num in nums:
if(num not in ht):
ht[num] = 1
else:
return True
return False