+/AoC
advent of code
git clone https://git.julia.blue/+/AoC
38c0746
master
1raw = map (lambda x :x .strip (),open ("input.txt" )) 2 3from collections import defaultdict 4reg = defaultdict (int ) 5allMaxes = [] 6 7for line in raw : 8line = line .split () 9reg [line [0 ]]+= ((line [1 ]== "inc" )* 2 - 1 )* int (line [2 ])* eval ("reg['" + line [4 ]+ "']" + line [5 ]+ line [6 ]) 10allMaxes .append (max (reg .values ())) 11 12"Part 1:" ,allMaxes [- 1 ] 13"Part 2:" ,max (allMaxes )