Skip to content

Commit 4b43dd0

Browse files
committed
fix: fix func name case
1 parent f2e8113 commit 4b43dd0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

leetcode/number_of_1_bits/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def run_hamming_weight(solution_class: type, n: int):
22
implementation = solution_class()
3-
return implementation.hammingWeight(n)
3+
return implementation.hamming_weight(n)
44

55

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

leetcode/number_of_1_bits/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(1) - at most 32 iterations (number of bits in int)
44
# Space: O(1) - only using constant extra space
5-
def hammingWeight(self, n: int) -> int:
5+
def hamming_weight(self, n: int) -> int:
66
"""
77
Count the number of set bits (1s) in the binary representation of n.
88

leetcode_py/cli/resources/leetcode/json/problems/number_of_1_bits.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"helpers_content": "",
3030
"helpers_run_name": "hamming_weight",
3131
"helpers_run_signature": "(solution_class: type, n: int)",
32-
"helpers_run_body": " implementation = solution_class()\n return implementation.hammingWeight(n)",
32+
"helpers_run_body": " implementation = solution_class()\n return implementation.hamming_weight(n)",
3333
"helpers_assert_name": "hamming_weight",
3434
"helpers_assert_signature": "(result: int, expected: int) -> bool",
3535
"helpers_assert_body": " assert result == expected\n return True",
@@ -43,9 +43,9 @@
4343
"_solution_methods": {
4444
"list": [
4545
{
46-
"name": "hammingWeight",
46+
"name": "hamming_weight",
4747
"signature": "(self, n: int) -> int",
48-
"body": " # TODO: Implement hammingWeight\n return 0"
48+
"body": " # TODO: Implement hamming_weight\n return 0"
4949
}
5050
]
5151
},

0 commit comments

Comments
 (0)