1436. Destination City

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1436

class Solution:
    def destCity(self, paths: List[List[str]]) -> str:
        s = {a for a, _ in paths}
        return next(b for _, b in paths if b not in s)