You are given the array
paths
, wherepaths[i] = [cityAi, cityBi]
means there exists a direct path going fromcityAi
tocityBi
. Return the destination city, that is, the city without any path outgoing to another city.It is guaranteed that the graph of paths forms a line without any loop, therefore, there will be exactly one destination city.
1 | class Solution { |