missing day 10 programs

2.py missing because it's very ugly and probably broken just now
Esse commit está contido em:
Juan José Gutiérrez de Quevedo Pérez 2020-12-11 14:53:05 +01:00
commit a58e31c982
4 arquivos alterados com 144 adições e 0 exclusões

12
10/1.py Normal file
Ver arquivo

@ -0,0 +1,12 @@
with open("input") as f:
content = [int(x.strip()) for x in f]
content.sort()
diffs = []
for i in range(len(content) -1 ):
diffs.append(content[i+1] - content[i])
ones = diffs.count(1) + 1
threes = diffs.count(3) + 1
print(ones * threes)

11
10/einput Normal file
Ver arquivo

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

31
10/einput2 Normal file
Ver arquivo

@ -0,0 +1,31 @@
28
33
18
42
31
14
46
20
48
47
24
23
49
45
19
38
39
11
1
32
25
35
8
17
7
9
4
2
34
10
3

90
10/input Normal file
Ver arquivo

@ -0,0 +1,90 @@
114
51
122
26
121
90
20
113
8
138
57
44
135
76
134
15
21
119
52
118
107
99
73
72
106
41
129
83
19
66
132
56
32
79
27
115
112
58
102
64
50
2
39
3
77
85
103
140
28
133
78
34
13
61
25
35
89
40
7
24
33
96
108
71
11
128
92
111
55
80
91
31
70
101
14
18
12
4
84
125
120
100
65
86
93
67
139
1
47
38