Skip to content

Commit 640d140

Browse files
committed
day 1
0 parents  commit 640d140

File tree

4 files changed

+232
-0
lines changed

4 files changed

+232
-0
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "/usr/bin/python3"
3+
}

Day01/report-input.txt

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
1446
2+
1893
3+
1827
4+
1565
5+
1728
6+
497
7+
1406
8+
1960
9+
1986
10+
1945
11+
1731
12+
1925
13+
1550
14+
1841
15+
1789
16+
1952
17+
1610
18+
1601
19+
1776
20+
1808
21+
1812
22+
1834
23+
1454
24+
1729
25+
513
26+
1894
27+
1703
28+
1587
29+
1788
30+
1690
31+
1655
32+
1473
33+
1822
34+
1437
35+
1626
36+
1447
37+
1400
38+
1396
39+
1715
40+
1720
41+
1469
42+
1388
43+
1874
44+
1641
45+
518
46+
1664
47+
1552
48+
1800
49+
512
50+
1506
51+
1806
52+
1857
53+
1802
54+
1843
55+
1956
56+
1678
57+
1560
58+
1971
59+
1940
60+
1847
61+
1902
62+
1500
63+
1383
64+
1386
65+
1398
66+
1535
67+
1713
68+
1931
69+
1619
70+
1519
71+
1897
72+
1767
73+
1548
74+
1976
75+
1984
76+
1426
77+
914
78+
2000
79+
1585
80+
1634
81+
1832
82+
1849
83+
1665
84+
1609
85+
1670
86+
1520
87+
1490
88+
1746
89+
1608
90+
1829
91+
1431
92+
1762
93+
1384
94+
1504
95+
1434
96+
1356
97+
1654
98+
1719
99+
1599
100+
1686
101+
1489
102+
1377
103+
1531
104+
1912
105+
144
106+
1875
107+
1532
108+
1439
109+
1482
110+
1420
111+
1529
112+
1554
113+
1826
114+
1546
115+
1589
116+
1993
117+
1518
118+
1708
119+
1733
120+
1876
121+
1953
122+
1741
123+
1689
124+
773
125+
1455
126+
1613
127+
2004
128+
1819
129+
1725
130+
1617
131+
1498
132+
1651
133+
2007
134+
1402
135+
728
136+
1475
137+
1928
138+
1904
139+
1969
140+
1851
141+
1296
142+
1558
143+
1817
144+
1663
145+
1750
146+
1780
147+
1501
148+
1443
149+
1734
150+
1977
151+
1901
152+
1547
153+
1631
154+
1644
155+
1815
156+
1949
157+
1586
158+
1697
159+
1435
160+
1783
161+
1772
162+
1987
163+
1483
164+
1372
165+
1999
166+
1848
167+
1512
168+
1541
169+
1861
170+
2008
171+
1607
172+
1622
173+
1629
174+
1763
175+
1656
176+
1661
177+
1581
178+
1968
179+
1985
180+
1974
181+
1882
182+
995
183+
1704
184+
1896
185+
1611
186+
1888
187+
1773
188+
1810
189+
1650
190+
1712
191+
1410
192+
1796
193+
1691
194+
1671
195+
1947
196+
1775
197+
1593
198+
656
199+
1530
200+
1743

Day01/report-repair.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
file_location = "report-input.txt"
2+
3+
#Open File
4+
input_file = open(file_location, 'r')
5+
6+
report = []
7+
8+
#Read in each as integer to report
9+
for line in input_file:
10+
report.append(int(line))
11+
12+
#Part One
13+
def part_one():
14+
for i in report:
15+
for j in report:
16+
if (i + j) == 2020:
17+
print("The Answer is %s x %s = %s" % (i,j,i*j))
18+
return True
19+
20+
def part_two():
21+
for i in report:
22+
for j in report:
23+
for k in report:
24+
if (i + j + k) == 2020:
25+
print("The Answer is %s x %s x %s = %s" % (i,j,k,i*j*k))
26+
return True
27+
part_one()
28+
part_two()

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# advent-of-code-2020

0 commit comments

Comments
 (0)