You are given an undirected graph with edges where edges[i] = [u_i, v_i, cnt_i] indicates that there is an edge between nodes u_i and v_i subdivided into cnt_i new nodes.
Subdividing an edge means replacing the edge between u_i and v_i with a chain of cnt_i new intermediate nodes, resulting in cnt_i + 1 new edges.
Starting at node
Return the total number of nodes (both original nodes and newly subdivided nodes) that can be reached from node maxMoves moves.
Constraints:
edges.length
edges[i].length
There are no multiple edges in the graph.
maxMoves
You are given an undirected graph with edges where edges[i] = [u_i, v_i, cnt_i] indicates that there is an edge between nodes u_i and v_i subdivided into cnt_i new nodes.
Subdividing an edge means replacing the edge between u_i and v_i with a chain of cnt_i new intermediate nodes, resulting in cnt_i + 1 new edges.
Starting at node
Return the total number of nodes (both original nodes and newly subdivided nodes) that can be reached from node maxMoves moves.
Constraints:
edges.length
edges[i].length
There are no multiple edges in the graph.
maxMoves