A terrible idea

This commit is contained in:
Dan Buch 2021-01-03 15:01:38 -05:00
parent a87124ed2e
commit 0268ccdc0a
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7
2 changed files with 21 additions and 0 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
.dep
**/target/
/hello_world/main
/aoc*/**/input

20
aoc2020/day01/solution.py Normal file
View File

@ -0,0 +1,20 @@
import sys
import typing
def main() -> int:
i, j = _find_2020_pair([int(s) for s in sys.stdin.read().split()])
print("{} * {} == {}".format(i, j, i * j))
return 0
def _find_2020_pair(inputs: typing.List[int]) -> typing.Tuple[int, int]:
for i in inputs:
for j in inputs:
if i + j == 2020:
return i, j
return 0, 0
if __name__ == "__main__":
sys.exit(main())