Simple bitset + dfs || c++ 
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
```cpp []
class Solution {
public:
vector<int> adj[101];
vector<bool> visited = vector<bool>(101, false);

void dfs(int v) {
    visited[v] = true;
    for (int u : adj[v]) {
        if (!visited[u])
            dfs(u);
    }
}
 static int intersect(const auto& A, const auto& B){
       return (A&B).count();
    }
    int numberOfComponents(vector<vector<int>>& p, int k) {
        int n =p.size(),m=p[0].size();
        vector<bitset<101>> A(n, 0);
        int i=0;
        for(auto& a: p){
            for(int x: a) A[i][x]=1;
            i++;
        } 
        for(int i =0;i<n;i++)
        {
            for(int j=0;j<n;j++)
            {
                const auto& X=A[i];
                const auto& Y=A[j];
                if(intersect(X,Y)>=k)
                {
                    
                    adj[i].push_back(j);
                    adj[j].push_back(i);
                }
            }
        }
        int ans=0;
        for(int i=0;i<n;i++)
        {
            if(adj[i].size()>=0 && !visited[i])
            {
                cout<<i<<endl;
                dfs(i);
                ans++;
            }
        }
        return ans;
    }
};
```
['C++']