+/AoC
advent of code
git clone https://git.julia.blue/+/AoC
38c0746
master
1with open ("input.txt" )as f : 2banks = map (int ,f .read ().split ()) 3 4archive = [] 5while True : 6archive .append (banks [:]) 7biggest = 0 8choose = 0 9for i in range (len (banks )): 10if banks [i ]> biggest : 11biggest = banks [i ] 12choose = i 13temp = banks [choose ] 14banks [choose ]= 0 15i = choose + 1 16while temp > 0 : 17banks [i % len (banks )]+= 1 18i += 1 19temp -= 1 20if banks in archive : 21break 22 23"Part 1:" ,len (archive ) 24 25"Part 2:" ,len (archive )- archive .index (banks )