Intersection of Two Arrays
Medium · rating 1300 · Hashing, Sorting
The first line has n and m. The second line has n integers, the third has m integers. Print the sorted, distinct values that appear in both, space-separated. If there are none, print an empty line.
Constraints: 1 ≤ n, m ≤ 105
Related problems
- Count Anagram Groups — Medium
- Sort by Frequency — Medium
- Election Winner — Medium
- K-th Smallest Element — Medium
- Leaderboard Ranking — Medium
- Median Value — Medium