Final solution of TaskB04

This commit is contained in:
eddie 2024-11-26 17:49:01 +01:00
parent 417d2efa32
commit 5c4e00956d
2 changed files with 19945 additions and 19438 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,17 +2,12 @@ import sys
import re
def solve(lines):
# filter all substrings that match
# print
# print(None, re.findall(r"\b\d+\b", lines[3]))
# return []
p = re.compile(r"\b\d+\b")
res = []
for l in lines:
m = re.findall(p, l)
if m:
res.append(' '.join(m) + '\n')
return res
p = re.compile(r"\d+")
return [
' '.join(re.findall(p, l)) + '\n'
for l in lines
if re.search(p, l)
]
if __name__ == "__main__":
lines = []