There is an undirected tree with n nodes labeled from n n
You are given an integer n and a edges of length n edges[i] restricted representing restricted nodes.
Return the maximum number of nodes you can reach from node restricted.
Note: Node
is guaranteed not to be a restricted node.
Constraints:
n
edges.length n
edges[i].length
n
edges represents a valid tree.
restricted.length n
restricted[i] n
All the values of restricted are unique.
There is an undirected tree with n nodes labeled from n n
You are given an integer n and a edges of length n edges[i] restricted representing restricted nodes.
Return the maximum number of nodes you can reach from node restricted.
Note: Node
is guaranteed not to be a restricted node.
Constraints:
n
edges.length n
edges[i].length
n
edges represents a valid tree.
restricted.length n
restricted[i] n
All the values of restricted are unique.