A structured workspace for solving LeetCode problems and maintaining high-quality study notes. The repository couples a simple Python CLI with a Google Sheets source to keep solutions, notes, and indexes synchronized.
- Solve or review at least one problem every day and log the result immediately.
- Maintain a clear, navigable record of solved problems.
- Capture approach, edge cases, and time/space complexity for easy review.
- Keep folders and indexes consistent through automated generation.
- Let automation rebuild notes each morning, then skim the diff to stay accountable.
- Notes/
blind75.md: Auto-generated study notes based on the Notes Sheet.
- Problems/
<Problem Title>/solution.py: Generated from the Solutions Sheet for that problem title.
- src/leetnotes/
- CLI and helper scripts for reading the sheets, normalizing titles/slugs, generating notes, and writing solution files.
- tests/
- Unit tests for the renderers and utilities.
- .github/workflows/
notes.yml: Workflow that runs on a schedule to update notes and solution files.
- pyproject.toml
- Build metadata for the CLI package.
- README.md
- Documentation for the repository.
- Two CSV inputs per list:
- Notes Sheet (CSV) — problem title, category, approach, time/space complexity, and study notes.
- Solutions Sheet (CSV) — problem title and solution code in a
solutioncolumn (plain text).
- The CLI resolves each problem title to the official LeetCode slug/URL and normalizes the repository layout so every problem has a dedicated folder.
- The CLI writes
solution.pyusing the code found in the Solutions Sheet for that problem. If multiple variants are provided (e.g., “Two Pointers”, “Heap”), files are suffixed accordingly. - The CLI generates the notes file under
Notes/(for exampleNotes/blind75.md) from the Notes Sheet. - A GitHub Actions workflow (
.github/workflows/notes.yml) runs the CLI on a schedule and commits any changes (new notes or updated solution files).
- Each problem has its own directory under
Problems/using the official title (optionally prefixed by its problem number). - The canonical implementation is written to
solution.pyfrom the Solutions Sheet. Additional variants can be added assolution_<variant>.py. - Complexity analysis and narrative notes are stored in the generated Markdown under
Notes/, not inside the solution code. - The CLI preserves code formatting from the sheet and aligns with LeetCode-style function signatures.
- Solve the problem on LeetCode.
- Update the Notes Sheet (CSV) with: problem title, category, approach, time complexity, space complexity, and notes.
- Add the solution code to the Solutions Sheet (CSV):
- Use the exact problem title in the title column.
- Put your Python solution code in the
solutioncolumn (plain text; no code fences).
- Run the CLI locally or wait for the GitHub Actions workflow to run. The CLI will:
- Create/update
Problems/<Problem Title>/solution.pyfrom the Solutions Sheet. - Regenerate
Notes/blind75.mdfrom the Notes Sheet.
- Create/update
This repository supports multiple curated lists, each with its own pair of sheets (Notes + Solutions). Examples include Blind 75, NeetCode 150, or any custom set you design.
- Prepare two Google Sheets for the new list with the same schema as above:
- Notes Sheet: problem title, category, approach, time/space complexity, notes.
- Solutions Sheet: problem title,
solution(Python code).
- Publish both sheets to CSV and copy their URLs.
- Set environment variables for the new list (example: NeetCode 150):
export SHEET_CSV_URL_NEETCODE150_NOTES="<csv-url-notes>" export SHEET_CSV_URL_NEETCODE150_SOLUTIONS="<csv-url-solutions>"
- Run the CLI with a matching profile name:
leetnotes --profile neetcode150
- Notes are generated at:
Notes/neetcode150.md - Solutions are written under:
Problems/NeetCode150/ - The profile mapping for the two CSV URLs is defined in
src/leetnotes/config.py. You can add as many profiles as you need.
For a custom “Dynamic Programming 50” set:
export SHEET_CSV_URL_DP50_NOTES="<csv-url-notes>"
export SHEET_CSV_URL_DP50_SOLUTIONS="<csv-url-solutions>"
leetnotes --profile dp50This will generate:
Notes/dp50.mdProblems/DP50/
The scheduled workflow will keep both notes and solution files up to date whenever you change either sheet.
This project is licensed under the MIT License. see the LICENSE file for details.