awelgorithms

Intersection of Two Arrays: the skills you need first

Updated

LeetCode · easy · hash sets. Put the smaller collection in a set, then probe it with the other.

open on LeetCode

Skills this problem builds on

Stuck on Intersection of Two Arrays? It is usually one of these. Get each one solid and the solution stops being a trick.

  1. Find common values with a set
  2. Hash the smaller collection
check which ones you have 10 minutes, free, no account.

More hash sets problems