提交:O(N)
class Solution:
def destCity(self, paths: List[List[str]]) -> str:
dic = {}
for i,v in paths:
dic[i] = v
tmp = paths[0][1]
while tmp in dic:
tmp = dic[tmp]
return tmp
标签:tmp,周赛,paths,5400,List,dic,187,str
来源: https://www.cnblogs.com/oldby/p/12823342.html