Back to questions

Intersection of Two Lists Amazon Python Interview Question

Intersection of Two Lists

Amazon Python Interview Question

Write a function to get the intersection of two lists.

For example, if A = [1, 2, 3, 4, 5], and B = [0, 1, 3, 7] then you should return [1, 3].

p.s. this is the same as question 9.1 in Ace the Data Science Interview.

Input

(Python)

Output