File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
leetcode_py/cli/resources/leetcode/json/problems
leetcode/number_of_1_bits Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11def 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
66def assert_hamming_weight (result : int , expected : int ) -> bool :
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" ,
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 },
You can’t perform that action at this time.
0 commit comments