This directory contains utility scripts for project maintenance and development.
⚠️ Note: These scripts are optional and intended for project maintainers and contributors. Core LeetCode practice functionality does NOT require these scripts.
| Script | Purpose | Usage |
|---|---|---|
new_problem.bat / new_problem.sh |
Create solution skeleton with optional tests | scripts\new_problem.bat 1 --with-tests (Windows)./scripts/new_problem.sh 1 --with-tests (Linux/macOS) |
run_tests.bat / run_tests.sh |
Run all tests for a problem | scripts\run_tests.bat 0001_two_sum (Windows)./scripts/run_tests.sh 0001_two_sum (Linux/macOS) |
run_case.bat / run_case.sh |
Run single test case | scripts\run_case.bat 0001_two_sum 1 (Windows)./scripts/run_case.sh 0001_two_sum 1 (Linux/macOS) |
Features:
- ✅ Generate solution skeletons from LeetCode metadata
- ✅ Auto-extract example test cases from problem descriptions
- ✅ Auto-generate
solve()function based on method signature - ✅ Run all test cases or individual cases
- ✅ Support for benchmarking and multiple solutions
- ✅ Cross-platform (Windows/Linux/macOS)
| Script | Purpose | Usage |
|---|---|---|
build_docs.bat / build_docs.sh |
Build documentation site locally | scripts\build_docs.bat --serve (Windows)./scripts/build_docs.sh --serve (Linux/macOS) |
Features:
- ✅ No Docker required
- ✅ No external tools required
- ✅ Simple one-command build
- ✅ Fast execution
- ✅ Interactive prompt for AI mind map generation (optional, requires OPENAI_API_KEY)
The new_problem script is a thin wrapper around python -m codegen new, providing full access to the code generation engine.
# Windows - Basic generation
scripts\new_problem.bat 1 # Two Sum
scripts\new_problem.bat 15 # 3Sum
# Windows - With automatic test files
scripts\new_problem.bat 1 --with-tests
# Windows - With auto-generated solve()
scripts\new_problem.bat 1 --solve-mode infer
# Windows - Combined (recommended for new problems)
scripts\new_problem.bat 1 --with-tests --solve-mode infer
# Windows - Preview without writing
scripts\new_problem.bat 1 --dry-run
# Linux/macOS
./scripts/new_problem.sh 1 --with-tests| Flag | Description |
|---|---|
--with-tests |
Generate .in/.out test files from LeetCode examples |
--solve-mode infer |
Auto-generate solve() function based on method signature |
--force |
Overwrite existing test files |
--dry-run |
Preview without writing files |
# Windows - Run all tests
scripts\run_tests.bat 0001_two_sum
scripts\run_tests.bat 0001_two_sum --all --benchmark
# Windows - Run single test case
scripts\run_case.bat 0001_two_sum 1
# Linux/macOS - Run all tests
./scripts/run_tests.sh 0001_two_sum
./scripts/run_tests.sh 0001_two_sum --all --benchmark
# Linux/macOS - Run single test case
./scripts/run_case.sh 0001_two_sum 1The build script will:
- Generate standard mind maps (Markdown)
- Generate mind maps (HTML)
- Ask if you want to generate AI-powered mind maps (requires OPENAI_API_KEY)
- Build MkDocs site
- Copy mind map files
# Windows
scripts\build_docs.bat
# Linux/macOS
./scripts/build_docs.shNote: AI mind map generation is optional. The script will prompt you during the build process. You can skip it if you don't have an OpenAI API key configured.
# Windows
scripts\build_docs.bat --serve
# Linux/macOS
./scripts/build_docs.sh --serveThen visit http://127.0.0.1:8000 in your browser.
- Local Documentation Build Options - Overview of all local build methods
- Manual Build Guide - Complete guide for manual script method
- Act Guide - Using act to simulate CI/CD
This directory may contain additional utility scripts in the future:
- Deployment scripts
- Maintenance scripts
- Development helper scripts
All scripts will follow the same naming convention: script_name.bat (Windows) and script_name.sh (Linux/macOS).