Skip to content

Conversation

@TechnoBlogger14o3
Copy link
Owner

@TechnoBlogger14o3 TechnoBlogger14o3 commented Dec 8, 2025

Note

Introduce automation to extract Striver SDE Sheet problems and auto-generate solutions, add the source PDF and problem JSON, and seed the repo with extensive problem scaffolding plus several implemented solutions.

  • Scripts/Automation:
    • Add scripts/extract_dsa_sheet_problems.py to parse DSA Sheets.pdf and generate striver_sde_sheet_problems.json with problem metadata and LeetCode slugs.
    • Add scripts/solve_striver_sheet.py to fetch LeetCode problems via GraphQL, generate multi-language solutions via OpenAI, scaffold directories, write READMEs, and auto-commit/push progress tracked in .striver_progress.json.
  • Data/Assets:
    • Add DSA Sheets.pdf and the generated striver_sde_sheet_problems.json.
  • Problem Scaffolding & Solutions:
    • Populate striver-sde-sheet/ with numerous problems (README + placeholders for solution.py/java/js).
    • Implementations included for selected problems (e.g., reverse-string, longest-consecutive-sequence, merge-intervals, longest-palindromic-substring, add-two-numbers, flood-fill, reorganize-string, longest-common-prefix).
  • Repo Hygiene:
    • Update .gitignore to ignore *.backup and .striver_progress.json.

Written by Cursor Bugbot for commit 4c65818. This will update automatically on new commits. Configure here.

if page_num % 10 == 0:
print(f"Processed {page_num} pages...")

print(f"Total pages: {len(pdf.pages)}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Variable accessed after context manager closes

The pdf variable is accessed at line 29 after the with pdfplumber.open(PDF_PATH) as pdf: block closes at line 27. At this point, the pdf object is no longer valid because the context manager has already closed it. Accessing pdf.pages outside the with block will fail or produce undefined behavior.

Fix in Cursor Fix in Web

for slug, pnum in all_slug_matches.items():
if slug not in existing_slugs:
# Check if we already have this problem number
existing_for_num = [p for p in problems if p["number"] == pnum]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Comparison uses incompatible numbering systems

The comparison p["number"] == pnum compares two incompatible numbering systems. The pnum variable holds problem numbers extracted from the PDF text (found near URLs), while p["number"] holds a sequential counter that increments as problems are extracted. These numbering schemes are unrelated, so the check incorrectly skips adding slugs when a sequential counter happens to coincide with a PDF number, or fails to detect duplicates when it should.

Fix in Cursor Fix in Web

@TechnoBlogger14o3 TechnoBlogger14o3 merged commit d1c7eb8 into main Dec 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants