Skip to content

Commit f0f9e4d

Browse files
authored
Update strange-printer-ii.py
1 parent b98b6b3 commit f0f9e4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/strange-printer-ii.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def has_cycle(adj, color, lookup):
3030
return False
3131

3232
boxes = collections.defaultdict(lambda:[len(targetGrid), len(targetGrid[0]), -1, -1])
33-
adj = collections.defaultdict(set)
3433
for r, row in enumerate(targetGrid):
3534
for c, v in enumerate(row):
3635
boxes[v][0] = min(boxes[v][0], r)
3736
boxes[v][1] = min(boxes[v][1], c)
3837
boxes[v][2] = max(boxes[v][2], r)
3938
boxes[v][3] = max(boxes[v][3], c)
39+
adj = collections.defaultdict(set)
4040
for color, (min_r, min_c, max_r, max_c) in boxes.iteritems():
4141
for r in xrange(min_r, max_r+1):
4242
for c in xrange(min_c, max_c+1):

0 commit comments

Comments
 (0)