You are given an integer n representing the number of nodes in a directed graph, labeled from edges, where edges[i] = [u_i, v_i, w_i] represents a directed edge from node u_i to node v_i with a traversal cost of w_i.
You can traverse any directed edge from u_i to v_i with cost w_i. Additionally, you may reverse any edge and traverse it in the opposite direction from v_i to u_i with a cost of
Return the minimum total cost to travel from node
Constraints:
n
edges.length
edges[i]
You are given an integer n representing the number of nodes in a directed graph, labeled from edges, where edges[i] = [u_i, v_i, w_i] represents a directed edge from node u_i to node v_i with a traversal cost of w_i.
You can traverse any directed edge from u_i to v_i with cost w_i. Additionally, you may reverse any edge and traverse it in the opposite direction from v_i to u_i with a cost of
Return the minimum total cost to travel from node
Constraints:
n
edges.length
edges[i]