':type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]'

def intersect(self, nums1, nums2):

    if (len(nums1) > len(nums2)):
        return self.intersect(nums2, nums1)
    def binary_search(compare, nums, left, right, target):
        while (left < right):
            mid = (left + ((right - left) / 2))
            if compare(nums[mid], target):
                right = mid
            else:
                left = (mid + 1)
        return left
    (nums1.sort(), nums2.sort())
    res = []
    left = 0
    for i in nums1:
        left = binary_search((lambda x, y: (x >= y)), nums2, left, len(nums2), i)
        if ((left != len(nums2)) and (nums2[left] == i)):
            res += (i,)
            left += 1
    return res
