class Solution(object): def intersect(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: List[int] """ o = [] for each in nums1: for q in nums2: if each == q: o.append(each) break return o n1=[1,2,2,1] n2=[2,2] o = Solution().intersect(n1, n2) print o