"RuntimeError: dictionary changed size during iteration" but it's not changed in the loop
"RuntimeError: dictionary changed size during iteration" but it's not changed in the loop Question: I’m solving this LeetCode problem and here’s my code: class Solution: def alienOrder(self, words: List[str]) -> str: adjacent = defaultdict(set) for i in range(1, len(words)): w1, w2 = words[i – 1], words[i] min_len = min(len(w1), len(w2)) if len(w1) > len(w2) and …