We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 282f684 commit 200678cCopy full SHA for 200678c
leetcode/alien_dictionary/solution.py
@@ -5,7 +5,7 @@ class Solution:
5
def alien_order(self, words: list[str]) -> str:
6
# Build adjacency list and in-degree count
7
adj: dict[str, set[str]] = {c: set() for word in words for c in word}
8
- in_degree = {c: 0 for c in adj}
+ in_degree = dict.fromkeys(adj, 0)
9
10
# Build graph by comparing adjacent words
11
for i in range(len(words) - 1):
0 commit comments