You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+72-25Lines changed: 72 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,50 +6,97 @@ Thank you for your interest in contributing! This repository welcomes contributi
6
6
7
7
### 1. Add New Problems
8
8
9
-
Use an LLM assistant (Cursor, GitHub Copilot Chat, Amazon Q) with the rule files:
9
+
For adding new LeetCode problems, please refer to the comprehensive guide:
10
10
11
-
- Include `.amazonq/rules/problem-creation.md` in your LLM context
12
-
- Ask: "Create LeetCode problem [number] ([name])"
11
+
📖 **[LLM-Assisted Problem Creation Guide](docs/llm-assisted-problem-creation.md)**
13
12
14
-
### 2. Enhance Test Cases
13
+
This document provides detailed instructions for using LLM assistants to generate new problems with proper templates, test cases, and documentation.
15
14
16
-
- Include `.amazonq/rules/test-quality-assurance.md` in your LLM context
17
-
- Ask: "Enhance test cases for [problem_name] problem"
15
+
**Acceptance Criteria:**
18
16
19
-
### 3. Improve Helper Classes
17
+
- All GitHub Actions CI checks must pass (includes linting, testing, security scanning, reproducibility verification, and minimum 10 test cases per problem)
18
+
- Proper type hints and code formatting
19
+
- Complete the solution (documentation is auto-generated)
20
20
21
-
- Add new data structure helpers in `leetcode_py/data_structures/`
22
-
- Follow existing patterns with generic types and visualization support
21
+
### 2. Other Contributions
23
22
24
-
### 4. Bug Fixes & Improvements
23
+
All other contributions are welcome! This includes:
25
24
26
-
- Fix issues in existing problems
27
-
- Improve documentation
28
-
- Enhance CI/CD workflows
25
+
- Bug fixes and improvements
26
+
- Documentation enhancements
27
+
- Helper class improvements
28
+
- CI/CD workflow enhancements
29
+
- Test case enhancements
30
+
- New data structure visualizations
31
+
32
+
**For small changes:** Feel free to open a pull request directly.
33
+
34
+
**For larger changes:** Please open an issue for discussion first.
35
+
36
+
I'm also open to feedback and suggestions for improving the project!
- Use modern type hints per [PEP 585](https://peps.python.org/pep-0585/)/[PEP 604](https://peps.python.org/pep-0604/): `list[str]`, `dict[str, int]`, `Type | None`
43
-
- Automated linting enforced by CI (black, isort, ruff, mypy)
44
-
- Minimum 12 test cases per problem
72
+
### 3. Make Changes and Test
45
73
46
-
## Pull Request Process
74
+
```bash
75
+
# Test specific problem
76
+
make p-test PROBLEM=problem_name
77
+
78
+
# Test all
79
+
make test
80
+
81
+
# Lint your changes
82
+
make lint
83
+
84
+
# Generate/regenerate problems (if needed)
85
+
make p-gen PROBLEM=problem_name
86
+
```
87
+
88
+
### 4. Submit Pull Request
89
+
90
+
```bash
91
+
# Commit and push to your fork
92
+
git add .
93
+
git commit -m "feat: your descriptive commit message"
94
+
git push origin your-feature-name
95
+
96
+
# Then create a pull request on GitHub from your fork to the main repository
97
+
```
47
98
48
-
1. Fork the repository
49
-
2. Create a feature branch
50
-
3. Make your changes
51
-
4. Run `make lint` and `make test`
52
-
5. Submit a pull request with clear description
99
+
**Ensure all GitHub Actions CI checks pass before requesting review.**
A Python package to generate professional LeetCode practice environments. Features automated problem generation from LeetCode URLs, beautiful data structure visualizations (TreeNode, ListNode, GraphNode), and comprehensive testing with 10+ test cases per problem. Built with professional development practices including CI/CD, type hints, and quality gates.
11
13
14
+
## Table of Contents
15
+
16
+
-[What's Included](#whats-included)
17
+
-[Quick Start](#quick-start)
18
+
-[Problem Structure](#problem-structure)
19
+
-[Key Features](#key-features)
20
+
-[Usage Patterns](#usage-patterns)
21
+
-[Development Setup](#development-setup)
22
+
-[Helper Classes](#helper-classes)
23
+
-[Commands](#commands)
24
+
-[Architecture](#architecture)
25
+
-[Quality Metrics](#quality-metrics)
26
+
12
27
**What makes this different:**
13
28
14
-
- 🤖 **[LLM-Assisted Workflow](https://github.com/wisarootl/leetcode-py#llm-assisted-problem-creation)**: Generate new problems instantly with AI assistance
29
+
- 🤖 **[LLM-Assisted Workflow](https://github.com/wisarootl/leetcode-py/blob/main/docs/llm-assisted-problem-creation.md)**: Generate new problems instantly with AI assistance
15
30
- 🎨 **Visual Debugging**: Interactive tree/graph rendering with Graphviz and anytree
16
31
- 🧪 **Production Testing**: Comprehensive test suites with edge cases and reproducibility verification
17
32
- 🚀 **Modern Python**: PEP 585/604 type hints, Poetry, and professional tooling
- ⚡ **[Powerful CLI](https://github.com/wisarootl/leetcode-py/blob/main/docs/cli-usage.md)**: Generate problems anywhere with `lcpy` command
19
35
20
-
## 🎯 What's Included
36
+
## <aid="whats-included"></a>🎯 What's Included
21
37
22
38
**Current**: All 75 problems from [Grind 75](https://www.techinterviewhandbook.org/grind75/) - the most essential coding interview questions curated by the creator of Blind 75.
23
39
24
-
**Future**: Planned expansion to all free Grind problems for comprehensive interview preparation.
40
+
**Future**: Planned expansion to all free Grind problems for comprehensive interview preparation.[Contributions welcome!](CONTRIBUTING.md)
25
41
26
-
## 🚀 Quick Start
42
+
## <aid="quick-start"></a>🚀 Quick Start
27
43
28
44
### System Requirements
29
45
30
-
-**Python 3.13+** - Modern Python runtime with latest type system features
lcpy gen -t grind-75 # Generate all Grind 75 problems
43
56
lcpy list -t grind-75 # List available problems
44
-
lcpy scrape -n 1 # Fetch problem data
45
57
46
58
# Start practicing
47
59
cd leetcode/two_sum
48
60
python -m pytest test_solution.py # Run tests
49
61
# Edit solution.py, then rerun tests
50
62
```
51
63
52
-
### Example
64
+
### Bulk Generation Example
53
65
54
66
```bash
55
67
lcpy gen --problem-tag grind-75 --output leetcode # Generate all Grind 75 problems
@@ -63,7 +75,7 @@ _Bulk generation output showing "Generated problem:" messages for all 75 Grind p
63
75
64
76
_Generated folder structure showing all 75 problem directories after command execution_
65
77
66
-
## 📁 Problem Structure
78
+
## <aid="problem-structure"></a>📁 Problem Structure
67
79
68
80
Each problem follows a consistent, production-ready template:
69
81
@@ -93,7 +105,7 @@ _Comprehensive parametrized tests with 10+ test cases - executable and debuggabl
93
105
94
106
_Beautiful colorful test output with loguru integration for enhanced debugging and test result visualization_
95
107
96
-
## ✨ Key Features
108
+
## <aid="key-features"></a>✨ Key Features
97
109
98
110
### Production-Grade Development Environment
99
111
@@ -143,33 +155,23 @@ _Simple arrow-based list representation for console output and test debugging_
143
155
144
156
_Interactive multi-cell playground with rich data structure visualization for each problem_
145
157
146
-
## 🔄 Usage Patterns
158
+
## <aid="usage-patterns"></a>🔄 Usage Patterns
147
159
148
160
### CLI Usage (Global Installation)
149
161
150
-
Perfect for quick problem generation anywhere:
151
-
152
-
```bash
153
-
# Generate specific problems
154
-
lcpy gen -n 1 -n 125 -n 206 # Multiple problems by number
155
-
lcpy gen -s two-sum -s valid-palindrome # Multiple problems by slug
156
-
157
-
# Bulk generation
158
-
lcpy gen -t grind-75 # All Grind 75 problems
159
-
lcpy gen -t grind-75 -d Easy # Only Easy problems from Grind 75
162
+
Perfect for quick problem generation anywhere. See the 📖 **[Complete CLI Usage Guide](https://github.com/wisarootl/leetcode-py/blob/main/docs/cli-usage.md)** for detailed documentation with all options and examples.
160
163
161
-
# Explore available problems
162
-
lcpy list # All problems
163
-
lcpy list -t grind-75 # Filter by tag
164
-
lcpy list -d Medium # Filter by difficulty
164
+
## <aid="development-setup"></a>🛠️ Development Setup
165
165
166
-
# Fetch problem data
167
-
lcpy scrape -n 1 > two_sum.json # Save problem data
168
-
```
166
+
For working within this repository to generate additional LeetCode problems using LLM assistance:
169
167
170
-
##🛠️ Development Setup
168
+
### Development Requirements
171
169
172
-
For working within this repository to generate additional LeetCode problems using LLM assistance:
170
+
-**Python 3.10+** - Modern Python runtime with latest type system features
0 commit comments