LeetCode --- 1436. Destination City 解题报告

Posted 杨鑫newlfe

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1436. Destination City 解题报告相关的知识,希望对你有一定的参考价值。

You are given the array paths, where paths[i] = [cityAi, cityBi] means there exists a direct path going from cityAi to cityBiReturn 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.

Example 1:

Input: paths = [["London","New York"],["New York","Lima"],["Lima","Sao Paulo"]]
Output: "Sao Paulo" 
Explanation: Starting at "London" city you will reach "Sao Paulo" city which is the destination city. Your trip consist of: "London" -> "New York" -> "Lima" -> "Sao Paulo".

Example 2:

Input: paths =

以上是关于LeetCode --- 1436. Destination City 解题报告的主要内容,如果未能解决你的问题,请参考以下文章

leetcode1436. Destination City

LeetCode --- 1436. Destination City 解题报告

LeetCode 1436 旅行终点站[Map] HERODING的LeetCode之路

LeetCode1436 旅行终点站

LeetCode 517. 超级洗衣机(贪心,不太理解)/ 223. 矩形面积 / 1436. 旅行终点站

LeetCode练习目录