Algorithm · Visa · Medium
Problem: Minimum Score of a Path Between Two Cities You are given a connected, undirected graph containing n cities labeled 1 through n. The roads are represented by roads, where roads[i] = [a_i, b_i, distance_i] describes a two-way road connecting cities a_i and b_i with score distance_i. For a path from city 1 to city n, define its score as the smallest distance of any road used along that path. A path is allowed to revisit cities and use roads more than once. Find and…
Checking your access…