Intersection Count

L2 Easy Arrays & Hashing
Concept
Set intersection returns the values present in both collections at once — a one-line way to answer "what do these share?"
Return how many distinct integers appear in both a and b. A shared value is counted once, even if repeated.
Examples
▸ a = [1, 2, 3], b = [2, 3, 4]
→ 2
▸ a = [1, 2], b = [3, 4]
→ 0
▸ a = [], b = [1]
→ 0
Progressive Hints
Hint 1 · Nudge
A shared value only needs to be found once, even if it shows up many times.
Hint 2 · Plan
Turn each array into a set, then compute their intersection, the values present in both. The answer is the size of that intersection.
Hint 3 · Approach
setA = set of all of a's values; setB = set of all of b's values. Return the size of the overlap between them.
Output
// Run your code to see the output here.