I use set.It's very simple.
return list(set(nums1) & set(nums2))
@yezhenbo Can you please let me know is the code valid. I don't think it's possible in Java
@sgandham His solution is in Python, not Java.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.