Easy DSU Solution, Simple Brute Force
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Disjoint{\n    public:\n    vector<int>par,size;\n    Disjoint(int n){\n        par.resize(n);\n        size.resize(n,1);\n        for(int i=0;i<n;i++){\n            par[i]=i;\n        }\n    }\n    int findPar(int node){\n        if(node == par[node]){\n            return node;\n        }\n        return par[node]=findPar(par[node]);\n    }\n    void unionBySize(int u,int v){\n        int ulp_u  = findPar(u);int ulp_v  = findPar(v);\n        if(ulp_u == ulp_v) return;\n        if(size[ulp_u]<size[ulp_v]){\n            size[ulp_v]+=size[ulp_u];\n            par[ulp_u]=ulp_v;\n        }\n        else{\n            size[ulp_u]+=size[ulp_v];\n            par[ulp_v]=ulp_u;\n        }\n    }\n};\nclass Solution {\npublic:\n    vector<bool> friendRequests(int n, vector<vector<int>>& res, vector<vector<int>>& req) {\n        vector<bool>ans(req.size());\n        Disjoint ds(n);\n        map<pair<int,int>,int>mp;\n        for(auto x:res){\n            mp[{x[0],x[1]}]=1;\n            mp[{x[1],x[0]}]=1;\n        }\n        for(int i=0;i<req.size();i++){\n            if(mp.find({req[i][0],req[i][1]})!=mp.end()){\n                ans[i]=0;\n            }\n            else{\n                Disjoint use(n);\n                use=ds;\n                int u = req[i][0];\n                int v = req[i][1];\n                ds.unionBySize(u,v);\n                bool flag=true;\n                for(int j =0;j<res.size();j++){\n                    int x = res[j][0];\n                    int y = res[j][1];\n                    if(ds.findPar(x)==ds.findPar(y)){\n                        flag=false;\n                    }\n                }\n                ans[i]=flag;\n                if(!flag){\n                    ds=use;\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']