def has_duplicates(array):
    """Use a dictionary to write a faster, simpler version of has_duplicates"""
    d = dict()
    for elem in array:
        if elem in d:
            return True
        d.setdefault(elem, 1)
    return False