You are given an integer n representing the number of nodes in an undirected graph, labeled from edges, where edges[i] k.
To traverse an edge, it must be repaired. If you have an amount of money equal to
Return the minimum amount of money required to travel from node k edges. If it is impossible to reach node k edges, return
Constraints:
n
edges.length
edges[i]
n
k n
There are no self loops or duplicate edges in the graph.
You are given an integer n representing the number of nodes in an undirected graph, labeled from edges, where edges[i] k.
To traverse an edge, it must be repaired. If you have an amount of money equal to
Return the minimum amount of money required to travel from node k edges. If it is impossible to reach node k edges, return
Constraints:
n
edges.length
edges[i]
n
k n
There are no self loops or duplicate edges in the graph.