# Two Out of Three (LeetCode 2032) Nums in at least two of three arrays. ## Approach ```python from collections import Counter def twoOutOfThree(a, b, c): ca, cb, cc = map(Counter, (a, b, c)) keys = set(ca)|set(cb)|set(cc) return [x for x in keys if (x in ca)+(x in cb)+(x in cc) >= 2] ``` ## Complexity - Time / space depend on the scan above; keep the solution linear when possible. ## Interview tip Narrate the invariant before coding. I drill these patterns with [Linkjob AI copilot](https://www.linkjob.ai/) ahead of OA rounds. *Disclosure: I work on Linkjob AI, an interview copilot. The algorithm above stands on its own.*