Empresa engajada
Given three arrays . Find the elements which are present on atleast two arrays and its complexity
Sigiloso
result = set() a=[1,2,3,4] b=[4,5,6,7] c=[3,4,8,9, 1] all=copy(a) for item in b: if item in all: result.add(item) else: all.append(item) for item in c: if item in all: result.add(item) else: all.append(item) print result Time Complexity is O(max(a,b,c))