mirror of
https://github.com/Crocmagnon/advent-of-code.git
synced 2024-11-24 15:38:10 +01:00
Complete 2020 day 1 part 2
This commit is contained in:
parent
37c8a76c72
commit
c52fe0aa76
1 changed files with 5 additions and 3 deletions
|
@ -8,9 +8,11 @@ def main():
|
|||
for i, value in enumerate(lines):
|
||||
for j in range(i+1, stop):
|
||||
other = lines[j]
|
||||
addition = other + value
|
||||
if addition == 2020:
|
||||
print("result is", other * value)
|
||||
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__':
|
||||
|
|
Loading…
Reference in a new issue