Pregunta de entrevista de Criteo

Write a function to find the intersection between two arrays.

Respuesta de la entrevista

Anónimo

11 de sept de 2021

there are many ways to write this function. If we want just to use native python language we can do : def inter(l1, l2): l3 = [v for v in l1 if v in l2] return l3 or we can for example use the intersection function like : def inter(l1, l2): l3 = set(l1).intersection(l2) return l3