Skip to content

Commit 98b2bbd

Browse files
Create 1436.py
1 parent fe0f33f commit 98b2bbd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

1001-1500/1436.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def destCity(self, paths: List[List[str]]) -> str:
3+
cities_with_outgoing_path = set()
4+
for ca,cb in paths:
5+
cities_with_outgoing_path.add(ca)
6+
for ca,cb in paths:
7+
if cb not in cities_with_outgoing_path:
8+
return cb
9+

0 commit comments

Comments
 (0)