def intersection(a, b):
    """
    intersection(list, list):
    """
    if not a:
        return []
    if not b:
        return []
    d = []
    for i in a:
        if i in b and i not in d:
            d.append(i)
    for i in b:
        if i in a and i not in d:
            d.append(i)
    return d
