"""
https://leetcode.com/problems/contains-duplicate/description/
Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
"""
from typing import List
def contains_duplicate(arr: List[int]) -> bool:
"""
one-liner:
return len(set(arr)) != len(arr)
"""
hash = set()
for i in arr:
if i in hash:
return True
hash.add(i)
return False