Python 
Complexity
Time complexity: N*N

Space complexity: O(N)
Code

# Complexity
- Time complexity: N*N
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(N)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def numberOfComponents(self, properties: List[List[int]], k: int) -> int:
        
        def intersect(a, b):
            return len(list(set(a) & set(b)))
        

        dic = {}
        for i in range(len(properties)):
            dic[i] = []

        for i in range(len(properties)):
            for j in range(i+1, len(properties)):
                if intersect(properties[i], properties[j]) >= k:
                    dic[i].append(j)
                    dic[j].append(i)

        component = 0
        visited = [False] * len(properties)

        def dfs(node):
            if visited[node]: return
            visited[node] = True

            for nei in dic[node]:
                dfs(nei)


        for i in range(len(properties)):
            if not visited[i]:
                dfs(i)
                component += 1
        
        return component
        

        




```
['Python3']