transfer vectors in unordered_set + BFS (C++)
ApproachTransfer vectors in properties to unordered_set in order to efficiently find edges in graph prapering process, after that just do bfs over the graph in
# Approach
<!-- Describe your approach to solving the problem. -->
Transfer vectors in properties to unordered_set<int> in order to efficiently find edges in graph prapering process, after that just do bfs over the graph in order to find connected components.

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

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

# Code
```cpp []
class Solution {
public:
    int numberOfComponents(vector<vector<int>>& properties, int k) {
        int ans = 0;
        int n = properties.size();
        vector <vector <int>> graph (n, vector <int>());
        vector<unordered_set<int>> vc;
        for(auto & it : properties)
            vc.push_back({it.begin(), it.end()});
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(i == j)
                    continue;
                if(intersact(vc[i], vc[j]) >= k){
                    graph[i].push_back(j);
                    graph[j].push_back(i);
                }
            }
        }
        vector <bool> visited (n, false);
        for(int i = 0; i < n; i++){
            if(!visited[i]){
                ans++;
                queue<int> que;
                que.push(i);
                visited[i] = true;
                while(!que.empty()){
                    int u = que.front();
                    que.pop();
                    for(auto & v : graph[u]){
                        if(!visited[v]){
                            visited[v] = true;
                            que.push(v);
                        }
                    }
                }
            }
        }
        return ans;
    }

    int intersact(unordered_set <int> &a, unordered_set <int> &b){
        int count = 0;
        for(auto & it : b)
            if(a.find(it) != a.end())
                count++;
        return count;
    }
};
```
['C++']