
[LeetCode] 3108. Minimum Cost Walk in Weighted Graph (Python)
·
알고리즘/LeetCode
난이도: HardProblem DescriptionThere is an undirected weighted graph with n vertices labeled from 0 to n - 1. You are given the integer n and an array edges, where edges[i] = [ui, vi, wi] indicates that there is an edge between vertices ui and vi with a weight of wi. A walk on a graph is a sequence of vertices and edges. The walk starts and ends with a vertex, and each edge connects the vertex that..