easy cpp solution using bitset and DSU
Code


# Code
```cpp []
class DSU {
public:
    vector<int> rank, parent;
    DSU(int n) {
        rank.resize(n + 1, 0);
        parent.resize(n + 1);
        for (int i = 0; i <= n; i++) {
            parent[i] = i;
        }
    }

    int find(int node) {
        if (node == parent[node]) {
            return node;
        }
        return parent[node] = find(parent[node]); 
    }

    bool Union(int u, int v) {
        int ulp_u = find(u); 
        int ulp_v = find(v); 
        if (ulp_u == ulp_v) return false; // Already in the same set
        
        if (rank[ulp_u] < rank[ulp_v]) {
            parent[ulp_u] = ulp_v;
        } else if (rank[ulp_v] < rank[ulp_u]) {
            parent[ulp_v] = ulp_u;
        } else {
            parent[ulp_v] = ulp_u;
            rank[ulp_u]++;
        }
        return true; // Successful union
    }
};

class Solution {
    static int intersect(const vector<int>& A, const vector<int>& B) {
        bitset<101> a, b;
        for (int x : A) a[x] = 1;
        for (int x : B) b[x] = 1;
        return (a & b).count();
    }

public:
    int numberOfComponents(vector<vector<int>>& properties, int k) {
        int n = properties.size();
        DSU uf(n);
        int components = n;
        
        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                if (intersect(properties[i], properties[j]) >= k) {
                    if (uf.Union(i, j)) {
                        components--;
                    }
                }
            }
        }
        
        return components;
    }
};
```
['C++']