def has_two_elements_that_sum_bonus(elements, k):
    """
    Bonus: This implementation is a bit uglier, but it's still O(n) space and goest over it once
    """
    required = set()
    for e in elements:
        difference = k - e
        if e in required:
            return True
        else:
            required.add(difference)
    return False