Trying to solve leetcode 217 using python:
from typing import List
nums = [1,2,3,1]
def containsDuplicate(self, nums: List[int]) -> bool:
hashset = set()
for n in nums:
if n in hashset:
return True
hashset.add(n)
return False
I supposed to get "False" or "True" from the output window, anything wrong with my code?