Python | Union Find 
Code
# Code
```python3 []
class Solution:
    def numberOfComponents(self, properties: List[List[int]], k: int) -> int:
        edges=[]
        for x in range(len(properties)-1):
            for y in range(x+1,len(properties)):
                hash1=set(Counter(properties[x]).keys())
                hash2=set(Counter(properties[y]).keys())
                if len(hash1.intersection(hash2))>=k:
                    edges.append((x,y))
                        
        par=[x for x in range(len(properties))]
        rank=[1]*len(properties)
        def find(n1):
            res=n1
            while res!=par[res]:
                par[res]=par[par[res]]
                res=par[res]
            return res
        def union(n1,n2):
            p1,p2=find(n1),find(n2)
            if p1==p2:
                return 0
            
            if rank[p1]>rank[p2]:
                rank[p1]+=rank[p2]
                par[p2]=p1
            else:
                rank[p2]+=rank[p1]
                par[p1]=p2
            return 1
        res=len(properties)
        for n1,n2 in edges:
            res-=union(n1,n2)
        return res
        
```
['Union Find', 'Python3']