Skip to content

Commit 1c2dd14

Browse files
committed
modify Github Action
- empty note
1 parent c3ba82d commit 1c2dd14

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

BaekJoon/Solutions/Solution_1275.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*
2+
@boj.idx: 1275
3+
@boj.tier: platinum
4+
@boj.title: 커피숍 2
5+
@boj.level: V
6+
@boj.tags: Data Structure, Segment Tree
7+
@boj.complexity: O(MlogN)/O(N)
8+
@boj.note:
9+
*/
10+
111
import java.util.*;
212
import java.io.*;
313

scripts/update_baekjoon_readme.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ def parse_meta(abs_path: Path, rel_path: str) -> BjMeta:
3737
text = abs_path.read_text(encoding="utf-8", errors="ignore")
3838

3939
def pick(key: str) -> str:
40-
m = re.search(rf"@boj\.{re.escape(key)}\s*:\s*(.*)\s*$", text, re.MULTILINE)
41-
return (m.group(1).strip() if m else "")
40+
for line in text.splitlines():
41+
line = line.strip()
42+
if line.startswith(f"@boj.{key}:"):
43+
return line.split(":", 1)[1].strip()
44+
return ""
4245

4346
idx_s = pick("idx")
4447
if not idx_s.isdigit():

scripts/update_leetcode_readme.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ def parse_meta_from_file(abs_path: Path, rel_path: str) -> LcMeta:
3737
text = abs_path.read_text(encoding="utf-8", errors="ignore")
3838

3939
def pick(key: str) -> str:
40-
m = re.search(rf"@lc\.{re.escape(key)}\s*:\s*(.*)\s*$", text, re.MULTILINE)
41-
return (m.group(1).strip() if m else "")
40+
for line in text.splitlines():
41+
line = line.strip()
42+
if line.startswith(f"@lc.{key}:"):
43+
return line.split(":", 1)[1].strip()
44+
return ""
4245

4346
idx_s = pick("idx")
4447
if not idx_s.isdigit():

0 commit comments

Comments
 (0)