This commit is contained in:
basicbonobo 2023-12-01 14:27:17 +01:00 committed by Eivind Øksnevad
parent 1334307ac1
commit 9d95020a1b
3 changed files with 1016 additions and 0 deletions

1000
input1 Normal file

File diff suppressed because it is too large Load Diff

12
one.py Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
from useful import *
def digits(l): # usually what we want really
return [int(x) for x in re.findall(r'-?[0-9]', l)]
ls = lines(open(0)) # pretty much every time, yeah
ns = [digits(l) for l in ls]
sums = [int(str(n[0]) + str(n[-1])) for n in ns]
print(sum(sums))

4
test1 Normal file
View File

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