File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 33from collections import defaultdict
44from common import *
55
6+ ORDER_SEPARATOR = '|'
7+ UPDATE_SEPARATOR = ','
8+
9+
10+ def get_print_instructions ():
11+ ordering = defaultdict (list )
12+ updates = []
13+
14+ for line in get_lines (strip_newlines = True ):
15+ if ORDER_SEPARATOR in line :
16+ before , after = map (int , line .split (ORDER_SEPARATOR ))
17+ ordering [before ].append (after )
18+ elif UPDATE_SEPARATOR in line :
19+ updates .append ([int (x ) for x in line .split (UPDATE_SEPARATOR )])
20+
21+ return ordering , updates
22+
623
724def part1 ():
8- print ('Part 1:' )
25+ ordering , updates = get_print_instructions ()
26+ count = 0
27+
28+ for update in updates :
29+ # for each update
30+ # check that pages follow the rules
31+ pass
32+
33+ print ('Part 1:' , count )
934
1035
1136def part2 ():
You can’t perform that action at this time.
0 commit comments