Electronic Arts interview question

Find the distinct elements in two arrays.

Interview Answer

Anonymous

9 Feb 2017

Python: def distinctEle(arr1, arr2): """ :type arr1: List[elements] :type arr2: List[elements] :rtype: List[elements] """ a = [i for i in arr1 if i not in arr2] b = [i for i in arr2 if i not in arr1] a.extend(b) return(list(set(a)))