2020 第 19 周 LeetCode 记录

Yiran at 
1436. Destination City 链接到标题 使用 set() 来计算每个城市是否处于起始和终止,集合差为终点站。class Solution: def destCity(self, paths: List[List[str]]) -> str: a = set() b = set() for path in paths: x, y = path a.add(x) b.add(y) b = b - a assert len(b) == 1 return b.pop() 1432. Max Difference You Can Get From Changing an Integer……