def phase2(l, sum):
    """
    Since we no longer assume an ordered list, the classic solution would be to
    calculate the diff on each element and save into memory.
    Than ask if we already seen a desired diff in the past, in case we did, return True

    Complexity O(n)
    """
    m = set()

    for element in l:
        diff = sum - element
        if diff in m:
            print("found diff {} for elemnt {}".format(diff, element))
            return True
        else:
            print("checking element {} adding {} to m>{}".format(element, diff, m))
            m.add(diff)
    return False