You are given an integer n and a queries.
There are n cities numbered from n i to city i i n
Each query queries[i] n
Return an array answer of length queries.length, where answer[i] is the length of the shortest path from city n i
Constraints:
n
queries.length
queries[i].length
queries[i][0] queries[i][1] n
queries[i][1] queries[i][0]
There are no repeated roads among the queries.
There are no two queries such that i j and queries[i][0] queries[j][0] queries[i][1] queries[j][1].
You are given an integer n and a queries.
There are n cities numbered from n i to city i i n
Each query queries[i] n
Return an array answer of length queries.length, where answer[i] is the length of the shortest path from city n i
Constraints:
n
queries.length
queries[i].length
queries[i][0] queries[i][1] n
queries[i][1] queries[i][0]
There are no repeated roads among the queries.
There are no two queries such that i j and queries[i][0] queries[j][0] queries[i][1] queries[j][1].