Medium
,DFS
,BFS
,Graph
2492. Minimum Score of a Path Between Two Cities
You are given a positive integer n
representing n
cities numbered from 1
to n
. You are also given a 2D array roads
where roads[i]
= [, , ] indicates that there is a bidirectional road between cities and with a distance equal to . The cities graph is not necessarily connected.
The score of a path between two cities is defined as the minimum distance of a road in this path.
Return the minimum possible score of a path between cities 1
and n
.
Note:
1
and n
multiple times along the path.1
and n
.Example 1:
Example 2:
Constraints:
n
<= 105roads.length
<= 105roads[i].length
== 3n
1
and n
.Yen-Chi ChenWed, Mar 22, 2023
Ron ChenWed, Mar 22, 2023
MarsgoatWed, Mar 22, 2023