Skip to content

Commit 3174f35

Browse files
committed
problem solution & test 0001
1 parent bc178bc commit 3174f35

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

scripts/update_readme.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,12 @@ def load_problems_cache():
7070

7171
def extract_problem_number(file_name: str) -> int | None:
7272
"""Извлекает номер задачи из имени файла."""
73-
if not file_name.endswith('.py') or not file_name[:-3].replace('_', '').isdigit():
74-
return None
75-
parts = file_name[:-3].split('_')
76-
if not parts:
77-
return None
78-
try:
79-
return int(parts[-1])
80-
except ValueError:
73+
if not file_name.endswith('.py'):
8174
return None
75+
match = re.search(r'(\d+)(?=_*\.py$)', file_name)
76+
if match:
77+
return int(match.group(1))
78+
return None
8279

8380

8481
def main():

solutions/two_sum_0001.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)