# №18. intersection_of_sorted(a: list, b: list) -> list # Найти пересечение двух отсортированных списков (без дубликатов). Сложность O(n+m). def intersec_mass(a: list, b: list): im = [] for i in a: for j in b: if i == j: im.append(i) return im print("Введите два массива для поиска пересечения") a = input().split() b = input().split() print(intersec_mass(a, b))