Selaa lähdekoodia

Add backedges in 20 (although not necessary)

Taddeus Kroes 7 vuotta sitten
vanhempi
sitoutus
d0bc98b827
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      20_regex.py

+ 1 - 1
20_regex.py

@@ -20,7 +20,7 @@ def parse(regex):
             x, y = cur
             vertex = x + dx, y + dy
             graph.setdefault(cur, []).append(vertex)
-            graph.setdefault(vertex, [])
+            graph.setdefault(vertex, []).append(cur)
             cur = vertex
 
     return graph