(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
1) Sort the sets (which takes $O(n \log{}n)$) and use the algorithm described in 2) which takes $O(n)$ (which is also $O(n \log{}n)$).