-
Notifications
You must be signed in to change notification settings - Fork 1
Strivers list #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…Stock with Cooldown
… Stock with Cooldown
… Stock with Cooldown
| if page_num % 10 == 0: | ||
| print(f"Processed {page_num} pages...") | ||
|
|
||
| print(f"Total pages: {len(pdf.pages)}") |
There was a problem hiding this comment.
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.
| 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] |
There was a problem hiding this comment.
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.
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/extract_dsa_sheet_problems.pyto parseDSA Sheets.pdfand generatestriver_sde_sheet_problems.jsonwith problem metadata and LeetCode slugs.scripts/solve_striver_sheet.pyto 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.DSA Sheets.pdfand the generatedstriver_sde_sheet_problems.json.striver-sde-sheet/with numerous problems (README + placeholders forsolution.py/java/js).reverse-string,longest-consecutive-sequence,merge-intervals,longest-palindromic-substring,add-two-numbers,flood-fill,reorganize-string,longest-common-prefix)..gitignoreto ignore*.backupand.striver_progress.json.Written by Cursor Bugbot for commit 4c65818. This will update automatically on new commits. Configure here.