DSU based solution 
I approched this solution by DSUI first solve these question to do this questionQuestion-1 (common element b/w two arrays)Question-2 (count the number of comple
<!-- # 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)$$ -->

### I approched this solution by DSU 

### I first solve these question to do this question
[Question-1 (common element b/w two arrays)](https://leetcode.com/problems/find-common-elements-between-two-arrays/description/)

[Question-2 (count the number of complete components)](https://leetcode.com/problems/count-the-number-of-complete-components/description/)

#### Good Luck 👍

# Code
```cpp []
class DisjointSet {
    public:
    vector<int> size, rank, parent;
    DisjointSet(int n) {
        size.resize(n+1, 1);
        rank.resize(n+1, 0);
        parent.resize(n+1);

        for(int i=0; i<=n; i++) parent[i] = i;
    }

    int findUltiParent(int n) {
        if(n == parent[n]) {
            return n;
        }
        return parent[n] = findUltiParent(parent[n]);
    }

    void unionByRank(int u, int v) {
        int root_u = findUltiParent(u);
        int root_v = findUltiParent(v);

        if(root_u == root_v) return;

        if(rank[root_u] < rank[root_v]) {
            parent[root_u] = root_v;
        }
        else if(rank[root_v] < rank[root_u]) {
            parent[root_v] = root_u;
        }
        else {
            parent[root_v] = root_u;
            rank[root_u]++;
        }
    }
};

class Solution {
public:
    bool intersect(unordered_set<int>& a, unordered_set<int>& b, int k) {
        int cnt = 0;
        for(auto it : a) {
            if(b.find(it) != b.end()) {
                cnt++;
            }
        }
        return cnt >= k;
    } 
    int numberOfComponents(vector<vector<int>>& properties, int k) {
        int n = properties.size();

        // SC->O(n*m)
        vector<unordered_set<int>> s(n);

         // TC->O(n*m)
        for(int i=0;i<n;i++){
            for(auto &it : properties[i]) {
                s[i].insert(it);
            }
        }

        DisjointSet dsu(n);

        // TC-> O(n^2 * m)
        for(int i=0; i<n; i++) {
            for(int j=i+1; j<n; j++) {
                if(intersect(s[i], s[j], k)) {
                    dsu.unionByRank(i, j);
                }
            }
        }

        // TC-> O(n * x(n)) x-> alpha
        int num_of_component = 0;
        for(int i=0; i<n; i++) {
            if(dsu.findUltiParent(i) == i) {
                num_of_component++;
            }
        }

        return num_of_component;
    }
};


// TC -> O(n*m + n^2 * m + n*x(n))
// SC -> O(n*m) 
```
['Union Find', 'C++']