mirror of
https://github.com/Crocmagnon/advent-of-code.git
synced 2024-11-05 14:23:58 +01:00
19 lines
515 B
Python
19 lines
515 B
Python
def main():
|
|
lines = []
|
|
with open("inputs/day01") as f:
|
|
for line in f:
|
|
lines.append(int(line.strip()))
|
|
|
|
stop = len(lines)
|
|
for i, value in enumerate(lines):
|
|
for j in range(i+1, stop):
|
|
other = lines[j]
|
|
for k in range(j+1, stop):
|
|
third = lines[k]
|
|
addition = other + value + third
|
|
if addition == 2020:
|
|
print("result is", other * value * third)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|