Merge branch 'main' of https://git.trwnh.com/a/aoc2020 into main

This commit is contained in:
a 2020-12-12 00:28:18 -06:00
commit 9cb41474df
61 changed files with 2494 additions and 0 deletions

6
2019/00/00.py Normal file
View File

@ -0,0 +1,6 @@
with open("input.txt","r") as f:
input = f.read().split('\n')
part1 = 0
part2 = 0
print(part1, part2)

15
2019/01/01.py Normal file
View File

@ -0,0 +1,15 @@
with open("input.txt","r") as f:
masses = [int(x) for x in f.read().split('\n')]
def fuel_required(mass):
return mass // 3 - 2
def fuel_required_recursive(mass):
fuel = mass // 3 - 2
if fuel <= 0:
return 0
return fuel + fuel_required_recursive(fuel)
part1 = sum([fuel_required(mass) for mass in masses])
part2 = sum([fuel_required_recursive(mass) for mass in masses])
print(part1, part2)

100
2019/01/input.txt Normal file
View File

@ -0,0 +1,100 @@
147077
148686
71851
98056
65024
87254
146003
128542
136657
91885
91904
78806
58210
67520
118393
68344
69593
135370
111892
84153
105683
76166
112780
145179
83811
61481
118277
59732
72222
64606
55645
82168
97590
122479
120365
103057
76225
148099
100610
75592
148678
132756
55335
77094
73992
95097
92382
78885
93657
121709
114261
90565
110043
145497
92066
109833
76107
143941
67084
139407
56730
131457
110026
85632
74239
116964
129806
75030
76317
99523
78069
75685
81279
58287
148135
89313
139141
136066
94046
50430
55242
123494
68410
83716
122608
79343
88826
95968
98603
104895
128814
120473
97504
60990
98132
58895
92987
136301
131747
137498

31
2019/02/02.py Normal file
View File

@ -0,0 +1,31 @@
def process(program):
i = 0
while True:
opcode = program[i]
if opcode == 99:
break
elif opcode == 1:
program[program[i+3]] = program[program[i+1]] + program[program[i+2]]
elif opcode == 2:
program[program[i+3]] = program[program[i+1]] * program[program[i+2]]
else:
break
i += 4
return program[0]
def alarm(noun, verb):
with open("input.txt","r") as f:
program = [int(x) for x in f.read().split(',')]
program[1] = noun
program[2] = verb
return process(program)
def part2():
for noun in range(100):
for verb in range(1,100):
if alarm(noun, verb) == 19690720:
return 100 * noun + verb
part1 = alarm(12,2)
part2 = part2()
print(part1, part2)

1
2019/02/input.txt Normal file
View File

@ -0,0 +1 @@
1,0,0,3,1,1,2,3,1,3,4,3,1,5,0,3,2,10,1,19,1,6,19,23,1,23,13,27,2,6,27,31,1,5,31,35,2,10,35,39,1,6,39,43,1,13,43,47,2,47,6,51,1,51,5,55,1,55,6,59,2,59,10,63,1,63,6,67,2,67,10,71,1,71,9,75,2,75,10,79,1,79,5,83,2,10,83,87,1,87,6,91,2,9,91,95,1,95,5,99,1,5,99,103,1,103,10,107,1,9,107,111,1,6,111,115,1,115,5,119,1,10,119,123,2,6,123,127,2,127,6,131,1,131,2,135,1,10,135,0,99,2,0,14,0

1
2019/02/input_sample.txt Normal file
View File

@ -0,0 +1 @@
1,9,10,3,2,3,11,0,99,30,40,50

View File

@ -0,0 +1 @@
1,0,0,0,99

27
2019/04/04.py Normal file
View File

@ -0,0 +1,27 @@
passwords = [str(p) for p in range(172851,675869+1)]
def monotonic(password):
digits = list(password)
if digits == sorted(digits):
return True
return False
def at_least_two_adjacent(password):
digits = list(password)
for i, digit in enumerate(digits):
if i+1 == len(digits):
return False
if digits[i+1] == digit:
return True
def exactly_two_adjacent(password):
if not at_least_two_adjacent(password):
return False
digits = list(password)
for digit in digits:
if password.count(digit) == 2:
return True
part1 = [p for p in passwords if monotonic(p) and at_least_two_adjacent(p)]
part2 = [p for p in passwords if monotonic(p) and exactly_two_adjacent(p)]
print(len(part1), len(part2))

1
2019/04/input.txt Normal file
View File

@ -0,0 +1 @@
172851-675869

33
2019/06/06.py Normal file
View File

@ -0,0 +1,33 @@
with open("input.txt","r") as f:
lines = f.read().split('\n')
orbits = {}
for line in lines:
parent, child = line.split(')')
orbits[child] = parent
def depth(node, graph):
depth = 1
parent = graph[node]
while parent != "COM":
depth += 1
parent = graph[parent]
return depth
def parents(node, graph):
path = []
parent = graph[node]
while parent != "COM":
path.append(parent)
parent = graph[parent]
return path
def orbital_transfers(start, end, graph):
path1 = parents(start, graph)
path2 = parents(end, graph)
set1 = set(path1)
set2 = set(path2)
return len((set1 - set2) | (set2 - set1)) # union of differences
part1 = sum([depth(x, orbits) for x in orbits.keys()])
part2 = orbital_transfers("YOU", "SAN", orbits)
print(part1, part2)

1799
2019/06/input.txt Normal file

File diff suppressed because it is too large Load Diff

11
2019/06/input_sample.txt Normal file
View File

@ -0,0 +1,11 @@
COM)B
B)C
C)D
D)E
E)F
B)G
G)H
D)I
E)J
J)K
K)L

13
2019/06/input_sample2.txt Normal file
View File

@ -0,0 +1,13 @@
COM)B
B)C
C)D
D)E
E)F
B)G
G)H
D)I
E)J
J)K
K)L
K)YOU
I)SAN

32
2019/08/08.py Normal file
View File

@ -0,0 +1,32 @@
from textwrap import wrap
with open("input.txt","r") as f:
width = 25
height = 6
layersize = width * height
data = f.read()
layers = wrap(data, layersize)
zeros = [layer.count("0") for layer in layers]
i = zeros.index(min(zeros))
part1 = layers[i].count("1") * layers[i].count("2")
print(part1)
top = []
for i, pixel in enumerate(layers[0]):
n = 0
while pixel == "2":
pixel = layers[n][i]
n += 1
top.append(pixel)
def print_image(layer, width, height):
output = ''
for x in layer:
output += x
output = output.replace("0","")
output = output.replace("1","")
output = wrap(output, width)
for line in output:
print(line)
print_image(top, width, height)

1
2019/08/input.txt Normal file

File diff suppressed because one or more lines are too long

0
2020/00/input.txt Normal file
View File

59
2020/10/10.py Normal file
View File

@ -0,0 +1,59 @@
def read_file():
with open("input.txt","r") as f:
return [int(x) for x in f.read().split('\n')]
def part1(adapters):
jolts = [0] + sorted(adapters) # j(port) = 0
d1 = 0
d3 = 1 # j(device) = max + 3
i = 0
while i <= len(adapters):
difference = jolts[i] - jolts[i-1]
if difference == 1:
d1 += 1
elif difference == 2:
d2 += 1
elif difference == 3:
d3 += 1
i += 1
return d1 * d3
"""
def find_all_paths(graph, start, end, path=[]):
path = path + [start]
if start == end:
return [path]
if start not in graph:
return []
paths = []
for node in graph[start]:
if node not in path:
newpaths = find_all_paths(graph, node, end, path)
for newpath in newpaths:
paths.append(newpath)
return paths
"""
def part2(adapters):
jolts = [0] + sorted(adapters)
from collections import Counter
dp = Counter()
dp[0] = 1
jolts = sorted(adapters)
jolts.append(jolts[-1] + 3)
for j in jolts:
dp[j] = dp[j-1] + dp[j-2] + dp[j-3]
return dp[jolts[-1]]
"""
graph = {}
for i, joltage in enumerate(jolts):
graph[joltage] = [x for x in jolts[i+1:i+4] if 0 < x - joltage <= 3] # scan next 3, assuming diff of +1 +1 +1 at most
return len( find_all_paths( graph, 0, max(jolts) ) )
"""
def main():
adapters = read_file()
print(part1(adapters), part2(adapters))
if __name__ == "__main__":
main()

98
2020/10/input.txt Normal file
View File

@ -0,0 +1,98 @@
35
111
135
32
150
5
106
154
41
7
27
117
109
63
64
21
138
98
40
71
144
13
66
48
12
55
119
103
54
78
65
112
39
128
53
140
77
34
28
81
151
125
85
124
2
99
131
59
60
6
94
33
42
93
14
141
92
38
104
9
29
100
52
19
147
49
74
70
84
113
120
91
97
17
45
139
90
116
149
129
87
69
20
24
148
18
58
123
76
118
130
132
75
110
105
1
8
86

11
2020/10/input_sample.txt Normal file
View File

@ -0,0 +1,11 @@
16
10
15
5
1
11
7
19
6
12
4

151
2020/11/11.py Normal file
View File

@ -0,0 +1,151 @@
def read_file():
with open("input.txt","r") as f:
seed = f.read().split('\n')
# pad with floor to prevent out-of-bounds checks
seats = []
seats.append(list('.' * (len(seed[0])+2)))
for row in seed:
seats.append(list('.' + row + '.'))
seats.append(list('.' * (len(seed[0])+2)))
return seats
def check_neighbors(state,i,j):
a = state[i-1][j-1]
b = state[i-1][j]
c = state[i-1][j+1]
d = state[i][j-1]
e = state[i][j+1]
f = state[i+1][j-1]
g = state[i+1][j]
h = state[i+1][j+1]
return a+b+c+d+e+f+g+h
from copy import deepcopy
def find_steady_state(seats):
height = len(seats)
width = len(seats[0])
state = deepcopy(seats)
prev_state = deepcopy(seats)
while True:
for i in range(height):
for j in range(width):
cell = prev_state[i][j]
if cell == ".":
pass
elif cell == "L":
# check for no occupied seats
neighbors = check_neighbors(prev_state,i,j)
if "#" not in neighbors:
state[i][j] = "#"
else:
state[i][j] = "L"
elif cell == "#":
# check for 4+ occupied seats
neighbors = check_neighbors(prev_state,i,j)
if neighbors.count("#") > 3:
state[i][j] = "L"
else:
state[i][j] = "#"
if state == prev_state:
break
prev_state = deepcopy(state)
return state
def part1(seats):
final_state = find_steady_state(seats)
output = ''
for row in final_state:
for character in row:
output += character
return output.count("#")
def check_line_of_sight(state,i,j):
height = len(state)
width = len(state[0])
a = "."
n = 1
while a == "." and i-n >= 0 and j-n >= 0:
a = state[i-n][j-n]
n += 1
b = "."
n = 1
while b == "." and i-n >= 0:
b = state[i-n][j]
n += 1
c = "."
n = 1
while c == "." and i-n >= 0 and j+n < width:
c = state[i-n][j+n]
n += 1
d = "."
n = 1
while d == "." and j-n >= 0:
d = state[i][j-n]
n += 1
e = "."
n = 1
while e == "." and j+n < width:
e = state[i][j+n]
n += 1
f = "."
n = 1
while f == "." and i+n < height and j-n >= 0:
f = state[i+n][j-n]
n += 1
g = "."
n = 1
while g == "." and i+n < height:
g = state[i+n][j]
n += 1
h = "."
n = 1
while h == "." and i+n < height and j+n < width:
h = state[i+n][j+n]
n += 1
return a+b+c+d+e+f+g+h
def find_steady_state_2(seats):
height = len(seats)
width = len(seats[0])
state = deepcopy(seats)
prev_state = deepcopy(seats)
while True:
for i in range(height):
for j in range(width):
cell = prev_state[i][j]
if cell == ".":
pass
elif cell == "L":
# check for no occupied seats
neighbors = check_line_of_sight(prev_state,i,j)
if "#" not in neighbors:
state[i][j] = "#"
else:
state[i][j] = "L"
elif cell == "#":
# check for 4+ occupied seats
neighbors = check_line_of_sight(prev_state,i,j)
if neighbors.count("#") > 4:
state[i][j] = "L"
else:
state[i][j] = "#"
if state == prev_state:
break
prev_state = deepcopy(state)
return state
def part2(seats):
pass
final_state = find_steady_state_2(seats)
output = ''
for row in final_state:
for character in row:
output += character
return output.count("#")
def main():
seats = read_file()
print(part1(seats), part2(seats))
if __name__ == "__main__":
main()

93
2020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