Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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)

AltStyle によって変換されたページ (->オリジナル) /