forked from miczar1/djfz-24_25
Final solution of TaskB04
This commit is contained in:
parent
417d2efa32
commit
5c4e00956d
File diff suppressed because it is too large
Load Diff
@ -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 = []
|
||||
|
Loading…
Reference in New Issue
Block a user