349 350 Intersection of two arrays

349

  1. hashSet remember to remove
  2. one is small one is large binary search
  3. sort two arrays using two pointers
  1. Intersection of Two Arrays II
    Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]
    hashmap
    sort + two pointers

你可能感兴趣的:(349 350 Intersection of two arrays)