Given two arrays, write a function to compute their intersection.
Each element in the result must be unique. The result can be in any order.
set only allows unique values. The key here is to create a
set for both
nums2 and then return the intersection of the two sets.
unique_nums1 & unique_nums2 returns another
set so it is important to convert that to a
O(n) because you need to run through both
O(n) because you need to allocate a set for each of the two arrays.
Apparently according to the fastest solutions on LeetCode, you can trim this down to a oneliner
return list(set(nums1) & set(nums2)).