Skip to content

Commit 7baf474

Browse files
committed
feat: dev
1 parent 4587633 commit 7baf474

File tree

9 files changed

+24
-3
lines changed

9 files changed

+24
-3
lines changed

.amazonq/rules/problem-creation.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ Required fields for `.templates/leetcode/json/{problem_name}.json`:
9393
- **method_name**: snake_case (e.g., "two_sum", "is_palindrome")
9494
- **parameters**: Use snake_case for all parameter names
9595

96+
### PascalCase Rules for Properties
97+
98+
When creating JSON properties that use PascalCase (solution_class_name, test_class_name):
99+
100+
- **Acronyms**: Keep all caps (e.g., "LRUCache" not "LruCache")
101+
- **Roman numerals**: Keep all caps (e.g., "ReverseLinkedListII" not "ReverseLinkedListIi")
102+
- **Common patterns**: "BST", "DFS", "BFS", "API", "URL", "HTML", "JSON", "XML"
103+
96104
## Special Problem Types
97105

98106
### Tree Problems

.templates/leetcode/examples/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ This directory contains comprehensive JSON5 template examples for different type
8484
- **Test Cases**: String representation of Python data structures
8585
- **Imports**: Include necessary helper classes (TreeNode, ListNode)
8686

87+
#### PascalCase Naming Rules
88+
89+
For `solution_class_name` and `test_class_name` properties:
90+
91+
- **Acronyms**: Keep all caps ("LRUCache" not "LruCache")
92+
- **Roman numerals**: Keep all caps ("ReverseLinkedListII" not "ReverseLinkedListIi")
93+
- **Common patterns**: "BST", "DFS", "BFS", "API", "URL", "HTML", "JSON", "XML"
94+
8795
### Template Selection Process
8896

8997
1. Identify problem type from description/title

.templates/leetcode/examples/basic.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
// Basic problem template - for array, string, number problems
33
// Example: Container With Most Water, Spiral Matrix
4+
// NOTE: PascalCase naming - keep acronyms/Roman numerals ALL CAPS (LRUCache, ReverseLinkedListII)
45

56
// === PROBLEM IDENTIFICATION ===
67
"problem_name": "container_with_most_water", // snake_case: used for directory/file names

.templates/leetcode/examples/design.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Design problem template - for data structure design problems
33
// Example: LRU Cache
44
// Key differences: Custom class name, multiple methods, complex test setup
5+
// NOTE: PascalCase naming - keep acronyms/Roman numerals ALL CAPS (LRUCache, ReverseLinkedListII)
56

67
// === PROBLEM IDENTIFICATION ===
78
problem_name: "lru_cache", // snake_case: used for directory/file names

.templates/leetcode/examples/linked_list.json5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Linked List problem template - for linked list problems
33
// Example: Reverse Linked List II
44
// Key differences: ListNode imports, list-specific test setup
5+
// NOTE: PascalCase naming - keep acronyms/Roman numerals ALL CAPS (LRUCache, ReverseLinkedListII)
56

67
// === PROBLEM IDENTIFICATION ===
78
problem_name: "reverse_linked_list_ii", // snake_case: used for directory/file names
@@ -49,7 +50,7 @@
4950
// === TEST CONFIGURATION ===
5051
// IMPORTANT: Linked list tests need ListNode import and special test setup
5152
test_imports: "import pytest\n\nfrom leetcode_py import ListNode\nfrom leetcode_py.test_utils import logged_test\n\nfrom .solution import Solution",
52-
test_class_name: "ReverseLinkedListIi", // PascalCase: TestClassName for pytest class
53+
test_class_name: "ReverseLinkedListII", // PascalCase: TestClassName for pytest class
5354
test_helper_methods: [
5455
{
5556
name: "setup_method",

.templates/leetcode/examples/matrix.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Matrix problem template - for 2D array/matrix problems
33
// Example: Spiral Matrix
44
// Key differences: 2D array parameters, often have visual examples with images
5+
// NOTE: PascalCase naming - keep acronyms/Roman numerals ALL CAPS (LRUCache, ReverseLinkedListII)
56

67
// === PROBLEM IDENTIFICATION ===
78
"problem_name": "spiral_matrix", // snake_case: used for directory/file names

.templates/leetcode/examples/tree.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Tree problem template - for binary tree problems
33
// Example: Invert Binary Tree
44
// Key differences: TreeNode imports, tree-specific test setup
5+
// NOTE: PascalCase naming - keep acronyms/Roman numerals ALL CAPS (LRUCache, ReverseLinkedListII)
56

67
// === PROBLEM IDENTIFICATION ===
78
problem_name: "invert_binary_tree", // snake_case: used for directory/file names

.templates/leetcode/json/reverse_linked_list_ii.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424
],
2525
"test_imports": "import pytest\n\nfrom leetcode_py import ListNode\nfrom leetcode_py.test_utils import logged_test\n\nfrom .solution import Solution",
26-
"test_class_name": "ReverseLinkedListIi",
26+
"test_class_name": "ReverseLinkedListII",
2727
"test_helper_methods": [
2828
{ "name": "setup_method", "parameters": "", "body": "self.solution = Solution()" }
2929
],

leetcode/reverse_linked_list_ii/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from .solution import Solution
77

88

9-
class TestReverseLinkedListIi:
9+
class TestReverseLinkedListII:
1010
def setup_method(self):
1111
self.solution = Solution()
1212

0 commit comments

Comments
 (0)