Lyft Interview Question

Common integers in two arrays.

Interview Answers

Anonymous

May 10, 2019

def findCommon(x,y): return list(set(x) & set(y))

Anonymous

Oct 5, 2020

def commonint(a,b): a_set = set(a) b_set = set(b) if (a_set & b_set): print(a_set & b_set)

Anonymous

Oct 5, 2020

Interviewer said using a set was not a useful solution. Didn't care that it outperformed their code in performance tests.

Anonymous

Oct 5, 2020

Interviewer said using a set was not a useful solution. Didn't care that it outperformed their code in performance tests.