Skip to content

Commit 84b9bb0

Browse files
committed
ci: fix ci
1 parent 6a6d97a commit 84b9bb0

File tree

18 files changed

+50
-31
lines changed

18 files changed

+50
-31
lines changed

.cursor/.dev/update_tags.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,14 @@ def update_tags(tag_names=None):
6767
# Only include missing problems in the update
6868
if missing_problems:
6969
update_tags[tag_name] = sorted(missing_problems)
70-
print(
71-
f"{tag_name}: Missing {len(missing_problems)} problems: {sorted(missing_problems)}"
72-
)
70+
missing_list = sorted(missing_problems)
71+
print(f"{tag_name}: Missing {len(missing_problems)} problems: {missing_list}")
7372

7473
if removed_problems:
74+
removed_list = sorted(removed_problems)
7575
print(
76-
f"{tag_name}: Removed {len(removed_problems)} problems: {sorted(removed_problems)} (not included in update)"
76+
f"{tag_name}: Removed {len(removed_problems)} problems: {removed_list} "
77+
f"(not included in update)"
7778
)
7879

7980
if not changes_found:

.cursor/commands/problem-creation.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,17 @@ The template below uses JSON5 format with comments for documentation purposes on
301301
- **problem_name**: snake_case (e.g., "two_sum", "valid_palindrome")
302302
- **solution_class_name**: Usually "Solution", except for design problems (e.g., "LRUCache")
303303
- **test_class_name**: PascalCase (e.g., "TwoSum", "ValidPalindrome")
304-
- **method_name**: snake_case (e.g., "two_sum", "is_palindrome")
304+
- **method_name**: snake_case (e.g., "two_sum", "is_palindrome", "character_replacement")
305305
- **parameters**: Use snake_case for all parameter names
306306

307+
**CRITICAL: Method Naming Convention**
308+
309+
- Always convert LeetCode method names from camelCase to snake_case
310+
- Example: `characterReplacement``character_replacement`
311+
- Example: `isSubtree``is_subtree`
312+
- Example: `countSubstrings``count_substrings`
313+
- This ensures Python convention compliance and consistency across the codebase
314+
307315
### PascalCase Rules for Properties
308316

309317
When creating JSON properties that use PascalCase (solution_class_name, test_class_name):

leetcode/longest_repeating_character_replacement/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def run_character_replacement(solution_class: type, s: str, k: int):
22
implementation = solution_class()
3-
return implementation.characterReplacement(s, k)
3+
return implementation.character_replacement(s, k)
44

55

66
def assert_character_replacement(result: int, expected: int) -> bool:

leetcode/longest_repeating_character_replacement/solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Solution:
22

33
# Time: O(n) - single pass through string
44
# Space: O(1) - at most 26 characters in count dict
5-
def characterReplacement(self, s: str, k: int) -> int:
5+
def character_replacement(self, s: str, k: int) -> int:
66
"""
77
Find the length of the longest substring with same character
88
after at most k replacements using sliding window approach.

leetcode/non_overlapping_intervals/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def run_erase_overlap_intervals(solution_class: type, intervals: list[list[int]]):
22
implementation = solution_class()
3-
return implementation.eraseOverlapIntervals(intervals)
3+
return implementation.erase_overlap_intervals(intervals)
44

55

66
def assert_erase_overlap_intervals(result: int, expected: int) -> bool:

leetcode/non_overlapping_intervals/solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Solution:
22

33
# Time: O(n log n) - sorting dominates
44
# Space: O(1) - no extra space used
5-
def eraseOverlapIntervals(self, intervals: list[list[int]]) -> int:
5+
def erase_overlap_intervals(self, intervals: list[list[int]]) -> int:
66
"""
77
Find minimum number of intervals to remove to make non-overlapping.
88
Uses greedy approach: sort by end time and keep intervals with earliest end times.

leetcode/palindromic_substrings/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def run_count_substrings(solution_class: type, s: str):
22
implementation = solution_class()
3-
return implementation.countSubstrings(s)
3+
return implementation.count_substrings(s)
44

55

66
def assert_count_substrings(result: int, expected: int) -> bool:

leetcode/palindromic_substrings/solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Solution:
22

33
# Time: O(n^2) - expand around centers approach
44
# Space: O(1) - no extra space used
5-
def countSubstrings(self, s: str) -> int:
5+
def count_substrings(self, s: str) -> int:
66
"""
77
Count palindromic substrings using expand around centers approach.
88
For each possible center (single char or between two chars), expand outward

leetcode/subtree_of_another_tree/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def run_is_subtree(solution_class: type, root_list: list[int | None], sub_root_l
55
root = TreeNode[int].from_list(root_list)
66
sub_root = TreeNode[int].from_list(sub_root_list)
77
implementation = solution_class()
8-
return implementation.isSubtree(root, sub_root)
8+
return implementation.is_subtree(root, sub_root)
99

1010

1111
def assert_is_subtree(result: bool, expected: bool) -> bool:

leetcode/subtree_of_another_tree/solution.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Solution:
55

66
# Time: O(m * n) - where m is nodes in root, n is nodes in subRoot
77
# Space: O(h) - where h is height of root tree (recursion stack)
8-
def isSubtree(self, root: TreeNode[int] | None, subRoot: TreeNode[int] | None) -> bool:
8+
def is_subtree(self, root: TreeNode[int] | None, subRoot: TreeNode[int] | None) -> bool:
99
"""
1010
Check if subRoot is a subtree of root.
1111
Uses DFS to check every node in root as potential subtree root.
@@ -20,7 +20,7 @@ def isSubtree(self, root: TreeNode[int] | None, subRoot: TreeNode[int] | None) -
2020
return True
2121

2222
# Recursively check left and right subtrees
23-
return self.isSubtree(root.left, subRoot) or self.isSubtree(root.right, subRoot)
23+
return self.is_subtree(root.left, subRoot) or self.is_subtree(root.right, subRoot)
2424

2525
def _is_same_tree(self, p: TreeNode[int] | None, q: TreeNode[int] | None) -> bool:
2626
"""Helper method to check if two trees are identical."""

0 commit comments

Comments
 (0)