day01: python
This commit is contained in:
parent
b48c1e67ef
commit
e656a6f8b3
1
01/day01.py
Normal file → Executable file
1
01/day01.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
import re
|
import re
|
||||||
# part 1
|
# part 1
|
||||||
with open("input.txt", "r") as file: print("Part 1:", sum([int(match[0]+match[-1]) for match in [re.findall(r"\d", line) for line in file.readlines()]]))
|
with open("input.txt", "r") as file: print("Part 1:", sum([int(match[0]+match[-1]) for match in [re.findall(r"\d", line) for line in file.readlines()]]))
|
||||||
|
Loading…
Reference in New Issue
Block a user