Array Intersection

Find common elements that exist in both arrays.

Code

General
b = set(arr2)
[x for x in arr1 if x in b]

Parameters

First array

Second array

Server

More Python Snippets