There is an undirected, weighted tree with edges of length edges[i] =
You are also given a queries of length queries[i] =
For each query, determine the minimum number of operations needed to make the weights of all edges on the path between nodes
Return an array answer of length answer[i] is the answer to the
Note: Each query is independent. Changing edge weights for one query does not affect the tree for other queries.
Constraints:
n
edges.length
edges[i].length
n
The input is generated such that edges represents a valid tree.
queries.length
queries[i].length
n
There is an undirected, weighted tree with edges of length edges[i] =
You are also given a queries of length queries[i] =
For each query, determine the minimum number of operations needed to make the weights of all edges on the path between nodes
Return an array answer of length answer[i] is the answer to the
Note: Each query is independent. Changing edge weights for one query does not affect the tree for other queries.
Constraints:
n
edges.length
edges[i].length
n
The input is generated such that edges represents a valid tree.
queries.length
queries[i].length
n