Skip to content

Commit 85bbb07

Browse files
authored
feat: add 15 more leetcodes (#74)
- add docs for batch-problem-creation and perform poc execution - add 15 more leetcodes
1 parent 68db0be commit 85bbb07

File tree

118 files changed

+4378
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+4378
-243
lines changed

.cursor/.dev/1-update-cookiecutter-test-template.md

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

.cursor/.dev/next_problem.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Import the problem lists
77
sys.path.append(str(Path(__file__).parent.parent.parent))
88
from problem_lists import available_lists
9+
from problem_lists.unscrapable import get_unscrapable_numbers
910
from problem_lists.utils import get_existing_problems
1011

1112

@@ -15,6 +16,7 @@ def get_next_problem(tag_names=None):
1516
tag_names = list(available_lists.keys())
1617

1718
existing_problems = get_existing_problems()
19+
unscrapable_numbers = get_unscrapable_numbers()
1820

1921
# Find the list with the lowest missing problems
2022
best_list = None
@@ -24,7 +26,8 @@ def get_next_problem(tag_names=None):
2426
for tag_name, problem_tuples in available_lists.items():
2527
if tag_name in tag_names:
2628
problem_numbers = {num for num, _ in problem_tuples}
27-
missing = problem_numbers - existing_problems
29+
# Exclude unscrapable problems from missing problems
30+
missing = problem_numbers - existing_problems - unscrapable_numbers
2831
missing_count = len(missing)
2932

3033
if missing_count > 0 and missing_count < min_missing:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Unscrapable Problems List
2+
# Problems that cannot be scraped due to being premium, having API issues, or other technical limitations
3+
4+
# Format: (problem_number, problem_name)
5+
UNSCRAPABLE_PROBLEMS = [
6+
(252, "meeting-rooms"),
7+
(253, "meeting-rooms-ii"),
8+
(261, "graph-valid-tree"),
9+
(271, "encode-and-decode-strings"),
10+
(323, "number-of-connected-components-in-an-undirected-graph"),
11+
# Add more unscrapable problems as discovered
12+
]
13+
14+
15+
# Helper function to check if a problem is unscrapable
16+
def is_unscrapable(problem_number: int) -> bool:
17+
"""Check if a problem number is in the unscrapable list."""
18+
return any(num == problem_number for num, _ in UNSCRAPABLE_PROBLEMS)
19+
20+
21+
def is_unscrapable_by_name(problem_name: str) -> bool:
22+
"""Check if a problem name is in the unscrapable list."""
23+
return any(name == problem_name for _, name in UNSCRAPABLE_PROBLEMS)
24+
25+
26+
def get_unscrapable_numbers() -> set[int]:
27+
"""Get all unscrapable problem numbers as a set."""
28+
return {num for num, _ in UNSCRAPABLE_PROBLEMS}

.cursor/.dev/update_tags.json

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

.cursor/.dev/update_tags.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,14 @@ def update_tags(tag_names=None):
6767
# Only include missing problems in the update
6868
if missing_problems:
6969
update_tags[tag_name] = sorted(missing_problems)
70-
print(
71-
f"{tag_name}: Missing {len(missing_problems)} problems: {sorted(missing_problems)}"
72-
)
70+
missing_list = sorted(missing_problems)
71+
print(f"{tag_name}: Missing {len(missing_problems)} problems: {missing_list}")
7372

7473
if removed_problems:
74+
removed_list = sorted(removed_problems)
7575
print(
76-
f"{tag_name}: Removed {len(removed_problems)} problems: {sorted(removed_problems)} (not included in update)"
76+
f"{tag_name}: Removed {len(removed_problems)} problems: {removed_list} "
77+
f"(not included in update)"
7778
)
7879

7980
if not changes_found:

0 commit comments

Comments
 (0)