Python UnionFind Concise Solution
\nclass Solution:\n    def friendRequests(self, n: int, restrictions: List[List[int]], requests: List[List[int]]) -> List[bool]:\n        size = [1] * (n + 1)\n
```\nclass Solution:\n    def friendRequests(self, n: int, restrictions: List[List[int]], requests: List[List[int]]) -> List[bool]:\n        size = [1] * (n + 1)\n        uf = [i for i in range(n+1)]\n        \n        def union(f, s):\n            root_f, root_s = find(f), find(s)\n            \n\t\t\t# loop over restrictions and return False if find any.\n            for item in restrictions:\n                cur_root = (find(item[0]), find(item[1]))\n                if cur_root == (root_f, root_s) or cur_root == (root_s, root_f):\n                    return False\n\t\t\t\t\t\n            # does not find any rstriction, union input and return True.\n            if size[root_f] >= size[root_s]:\n                uf[root_s] = root_f\n                size[root_f] += size[root_s]\n            else:\n                uf[root_f] = root_s\n                size[root_s] += size[root_f]\n            \n            return True\n        \n        def find(node):\n            while uf[node] != node:\n                node = uf[node]\n            \n            return node\n        \n        res = []\n        for s, t  in requests:\n            res.append(union(s, t))\n        \n        return res\n            \n```
[]