class Solution(object):
def intersection(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
nums1=set(nums1)
nums2=set(nums2)
return list(nums1&nums2)
Python code, 3 lines using set

@cheffyu because this answer just used the python implementation of intersection, it is same as
return set(nums2).intersection(nums2)
If you do this during interview, it would definitely not impress the interviewer.

@cheffyu
I think the reason is that this is not an algorithm solution. The "intersection" operation of two arrays ("lists" here in Python) should be IMPLEMENTED, rather then USED. The problems here we are working on are under the topic of "Algorithm", and this solution just uses the builtin (it's good, but it's not the wanted one). If Python can use all its builtin and libraries, many hard problems here is not a real problem.