[C++] Easy dfs solution
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```\nclass Solution {\npublic:\nvector<int> par;\n\nint find(int x){\n    if(x == par[x]) return x;\n    return par[x] = find(par[x]);\n}\n\nvoid merge(int x,int y){\n    x = find(x);\n    y = find(y);\n\n    if(y>x) swap(x,y);\n\n    par[x] = y;\n}\n\n    vector<bool> friendRequests(int n, vector<vector<int>>& restrictions, vector<vector<int>>& requests) {\n\n        vector<bool> finalStatus;\n\n        par.resize(n);\n        for(int i=0;i<n;i++)\n        par[i] = i;\n\n\n        for(auto &request:requests){\n            int x = find(request[0]);\n            int y = find(request[1]);\n\n            bool flag = 1;\n\n            for(auto &restriction:restrictions){\n                int a = find(restriction[0]);\n                int b = find(restriction[1]);\n\n                if((a==x && y==b) || (a==y && x==b)){\n                    flag = 0;\n                    break;\n                }\n            }\n            if(flag)\n            merge(x,y);\n            finalStatus.push_back(flag);\n\n        }\n\n        return finalStatus;\n    }\n};\n```
['C++']