You are given an undirected tree with edges of length edges[i] = [a_i, b_i] denotes an edge connecting nodes a_i and b_i.
You are also given two binary strings start and target, both of length
In one operation, you can toggle an edge with index a_i and b_i from '
Return a list containing the indices of the edges that must be toggled to transform start into target. If there is no valid sequence of toggles, return [-1].
Constraints:
start.length target.length
edges.length
edges[i] = [a_i, b_i]
start[i] is either '
target[i] is either '
The input is generated such that edges represents a valid tree.
You are given an undirected tree with edges of length edges[i] = [a_i, b_i] denotes an edge connecting nodes a_i and b_i.
You are also given two binary strings start and target, both of length
In one operation, you can toggle an edge with index a_i and b_i from '
Return a list containing the indices of the edges that must be toggled to transform start into target. If there is no valid sequence of toggles, return [-1].
Constraints:
start.length target.length
edges.length
edges[i] = [a_i, b_i]
start[i] is either '
target[i] is either '
The input is generated such that edges represents a valid tree.