This commit is contained in:
Andy Teijelo 2023-12-01 09:29:09 -05:00
commit d4fa8165f0
3 changed files with 1017 additions and 0 deletions

4
example.txt Normal file
View file

@ -0,0 +1,4 @@
1abc2
pqr3stu8vwx
a1b2c3d4e5f
treb7uchet

1000
input.txt Normal file

File diff suppressed because it is too large Load diff

13
solve.py Normal file
View file

@ -0,0 +1,13 @@
import sys
import re
sum = 0
for line in sys.stdin:
line = re.sub(r'[^\d]', '', line)
first = line[0]
last = line[-1]
value = int(first + last)
sum += value
print(sum)