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
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.