LeetCode #: 350
Difficulty: Easy
Topics: Hash table, two pointers, binary search, sort.
The solution here aims to also cater for the follow up questions in the problem.
First, we sort both the nums1
and nums2
arrays. Then, we use the two pointers technique on the sorted arrays to find their intersections.