C++ Solution. union-find and brute-force.
\n\n### Idea\n- Try to make a connection for each request, after making this connection and if one of the restrictions is violated, then the answer is false and
\n\n### Idea\n- Try to make a connection for each request, after making this connection and if one of the restrictions is violated, then the answer is false and recover the union-find array to the previous status.\n  \n```\nclass Solution {\npublic:\n    vector<int> arr;\n    vector<int> vis;\n    int find(int x) {\n        if(arr[x] == 0) return arr[x] = x;\n        if(arr[x] == x) return x;\n        return arr[x] = find(arr[x]);\n    }\n    void combine(int a, int b) {\n        a = find(a);\n        b = find(b);\n        arr[a] = b;\n    }\n    vector<bool> friendRequests(int n, vector<vector<int>>& restrictions, vector<vector<int>>& requests) {\n        arr.resize(n + 2);\n        vector<bool> ans(requests.size());\n        for(int i = 0; i < requests.size(); i++) {\n            int a = requests[i][0] + 1, b = requests[i][1] + 1;\n            auto src = arr;\n            combine(a, b);\n            ans[i] = true;\n            for(auto &r : restrictions) {\n                int a = r[0] + 1, b = r[1] + 1;\n                if(find(a) == find(b)) {\n                    ans[i] = false;\n                    break;\n                }\n            }\n            if(!ans[i]) arr = src;\n        }\n        return ans;\n    }\n};\n```
[]