1436. Destination City

Updated: 2024-03-12
1 min read
[]

On This Page

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)