Intersection Count
L2 Easy Arrays & Hashing
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