A terrible idea
This commit is contained in:
parent
a87124ed2e
commit
0268ccdc0a
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@
|
||||
.dep
|
||||
**/target/
|
||||
/hello_world/main
|
||||
/aoc*/**/input
|
||||
|
20
aoc2020/day01/solution.py
Normal file
20
aoc2020/day01/solution.py
Normal 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())
|
Loading…
Reference in New Issue
Block a user