a = list(map(int, input().split())) b = list(map(int, input().split())) def intersection(a, b): c = [] i, j = 0, 0 while i != len(a): if a[i] < b[j]: i += 1 elif a[i] >= b[j]: while j != len(b): if a[i] == b[j]: c.append(a[i]) i += 1 break else: j += 1 else: i += 1 j = 0 return c print(*intersection(a, b)) 
  • Attach a task to the question, no one will parse your code to understand the essence of the task. - RiotBr3aker
  • There is not so much a test of time as the algorithm itself is incorrect. For example, for lists [3, 4] and [5,3] he will not find anything from you. Tip - sorting the list is n * log (n), which is less than your quadratic complexity. - andy.37

0