SImple Python Solution using Union Find
Intuition
Create the edges list first by going through the number properties array as described.
Solve for the nos of connected Components using the Union Find
# Intuition
1. Create the edges list first by going through the number properties array as described.
2. Solve for the nos of connected Components using the Union Find algorithm based on the edge list same as Problem Number:- **323. Number of Connected Components in an Undirected Graph**

# Approach

# Complexity
- Time complexity:
**O(n^2 * m)** For generating the edges. Union Find due to path compression and union by rank omptimzation take O(1) does for n edges.

- Space complexity:
**O(n^2)**

# Code
```python3 []
class Solution:
    def numberOfComponents(self, properties: List[List[int]], k: int) -> int:
        def intersect(list1, list2, k) -> bool:
            list1 = set(list1)
            list2 = set(list2)
            return len(list1.intersection(list2)) >= k

        edges = []
        n = len(properties)
        R = len(properties)
        for r in range(R):
            for c in range(r+1, R):
                if intersect(properties[r], properties[c], k): edges.append([r, c])
        
        rank = [1 for i in range(n)]
        parent = [i for i in range(n)]
        def find(n):
            while n != parent[n]:
                parent[n] = parent[parent[n]]
                n = parent[n]
            return n

        def union(a, b):
            p1, p2 = find(a), find(b)
            if p1 == p2: return 0
            elif rank[p1] > rank[p2]:
                rank[p1] += rank[p2]
                parent[p2] = p1
            else:
                rank[p2] += rank[p1]
                parent[p1] = p2
            return -1

        for a, b in edges:
            n += union(a, b)
        return n
```
['Python3']