simple python DFS solution
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

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

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

# Code
```python3 []
class Solution:
    def numberOfComponents(self, properties: List[List[int]], k: int) -> int:
        graph = defaultdict(list)
        visited = set()
        res = 0

        def intersect(a, b):
            return len(set(a) & set(b))
        
        for i in range(len(properties) - 1):
            for j in range(i + 1, len(properties)):
                if intersect(properties[i], properties[j]) >= k:
                    graph[i].append(j)
                    graph[j].append(i)

        def dfs(idx):
            for neigh in graph[idx]:
                if neigh not in visited:
                    visited.add(neigh)
                    dfs(neigh)

        for i in range(len(properties)):
            if i not in visited:
                dfs(i)
                res += 1
        
        return res
```
['Array', 'Hash Table', 'Depth-First Search', 'Graph', 'Python3']