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
- 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
45
+
46
+
## Pull Request Process
47
+
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
53
+
54
+
## Questions?
55
+
56
+
Open an issue for questions or discussions about contributions.
Premium LeetCode practice repository with Python solutions, algorithm templates, data structure visualizations, and automated testing. Perfect for coding interview preparation, competitive programming, and mastering algorithms with Blind 75, Grind 75, and NeetCode 150 problems.
10
+
A modern Python LeetCode practice environment that goes beyond basic problem solving. Features automated problem generation from LeetCode URLs, beautiful data structure visualizations (TreeNode, ListNode, GraphNode), and comprehensive testing with 12+ test cases per problem. Built with professional development practices including CI/CD, type hints, and quality gates.
11
+
12
+
**What makes this different:**
13
+
14
+
- 🤖 **LLM-Assisted Workflow**: Generate new problems instantly with AI assistance
15
+
- 🎨 **Visual Debugging**: Interactive tree/graph rendering with Graphviz and anytree
16
+
- 🧪 **Production Testing**: Comprehensive test suites with edge cases and reproducibility verification
17
+
- 🚀 **Modern Python**: PEP 585/604 type hints, Poetry, and professional tooling
Includes all **75 Grind problems** - the most essential coding interview questions curated for maximum impact.
21
+
22
+
## 🎯 What's Included
23
+
24
+
**Current**: All 75 problems from [Grind 75](https://www.techinterviewhandbook.org/grind75/) - the most essential coding interview problems curated by the creator of Blind 75.
25
+
26
+
**Future**: Planned expansion to all 169 Grind problems for comprehensive interview preparation.
-**Bulk regeneration** - `make gen-all-problems` from JSON templates
95
-
-**Full linting** - black, isort, ruff, mypy with nbqa for notebooks
96
-
-**Modern Python** - PEP 585/604 syntax with full type hints
97
+
## 🔄 Usage Patterns
97
98
98
-
##🔄 Workflow Examples
99
+
### For Current Grind 75 Problems
99
100
100
-
**Practice existing problems**:
101
+
Perfect if you want to focus on the most essential interview problems:
101
102
102
103
```bash
103
-
# Work on a specific problem
104
-
make p-test PROBLEM=lru_cache
105
-
# Edit leetcode/lru_cache/solution.py
106
-
# Run tests to verify
104
+
# Regenerate all 75 problems with fresh TODO placeholders
105
+
make gen-all-problems
107
106
108
-
# Or use make p-test if default problem is set in Makefile
109
-
make p-test
107
+
# Work through problems systematically
108
+
make p-test PROBLEM=two_sum
109
+
make p-test PROBLEM=valid_palindrome
110
+
make p-test PROBLEM=merge_two_sorted_lists
110
111
```
111
112
112
-
**Add new problems**:
113
+
### For Additional Problems (LLM-Assisted)
114
+
115
+
If you need more problems beyond Grind 75, use an LLM assistant in your IDE (Cursor, GitHub Copilot Chat, Amazon Q, etc.):
113
116
114
117
```bash
115
-
# Ask your LLM assistant:
116
-
# "Create LeetCode problem 146 (LRU Cache)"
117
-
# The assistant handles everything automatically!
118
+
# Example commands to give your LLM assistant:
119
+
"Create LeetCode problem 146 (LRU Cache)"
120
+
"Add problem 'Word Ladder' by number 127"
121
+
"Generate problem 'Serialize and Deserialize Binary Tree'"
122
+
123
+
# For test enhancement (when you need more comprehensive test coverage):
124
+
"Enhance test cases for two_sum problem"
125
+
"Fix test reproducibility for binary_tree_inorder_traversal"
118
126
```
119
127
120
-
_Behind the scenes: Assistant follows `.amazonq/rules/problem-creation.md` to scrape problem data, create JSON template, generate structure with `make p-gen`, and verify with `make lint`._
128
+
**Required LLM Context**: Include these rule files in your LLM context for automated problem generation and test enhancement:
129
+
130
+
-[`.amazonq/rules/problem-creation.md`](.amazonq/rules/problem-creation.md) - Complete problem generation workflow
131
+
-[`.amazonq/rules/test-case-enhancement.md`](.amazonq/rules/test-case-enhancement.md) - Test enhancement and reproducibility verification
121
132
122
-
**Bulk operations**:
133
+
**Manual Check**: Find problems needing more test cases:
123
134
124
135
```bash
125
-
# Test all problems
126
-
make test
127
-
# Regenerate all from templates
128
-
make gen-all-problems
129
-
# Check code quality
130
-
make lint
136
+
poetry run python .templates/check_test_cases.py --threshold=10
131
137
```
132
138
133
-
## 🧰 Helper Classes (ongoing)
139
+
## 🧰 Helper Classes
134
140
135
141
-**TreeNode**: `from leetcode_py import TreeNode`
136
-
- Beautiful tree visualization with anytree rendering
137
-
- Jupyter notebook support with Graphviz diagrams
138
-
- Easy array ↔ tree conversion for testing
142
+
- Array ↔ tree conversion: `TreeNode.from_list([1,2,3])`, `tree.to_list()`
143
+
- Beautiful anytree text rendering and Graphviz SVG for Jupyter
144
+
- Node search: `tree.find_node(value)`
145
+
- Generic type support: `TreeNode[int]`, `TreeNode[str]`
146
+
139
147
-**ListNode**: `from leetcode_py import ListNode`
140
-
- Clean arrow visualization (`1 -> 2 -> 3`)
141
-
- Simple array ↔ list conversion
142
-
- Perfect for debugging linked list problems
143
-
- New helpers: Add to `leetcode_py/`
148
+
- Array ↔ list conversion: `ListNode.from_list([1,2,3])`, `node.to_list()`
149
+
- Cycle detection with Floyd's algorithm
150
+
- Graphviz visualization for Jupyter notebooks
151
+
- Generic type support: `ListNode[int]`, `ListNode[str]`
0 commit comments