Skip to content

Commit 0f7addd

Browse files
committed
Final Revisions
1 parent ee42edc commit 0f7addd

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

combination-sum/HYUNAHKO.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ def backtrack(start_idx, current_combination, current_sum):
2222

2323
backtrack(0, [], 0)
2424
return result
25-

number-of-1-bits/HYUNAHKO.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ def hammingWeight(self, n: int) -> int:
77
result+=1
88
n = n//2
99
return result
10-

product-of-array-except-self/HYUNAHKO.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,24 @@ def productExceptSelf(self, nums: List[int]) -> List[int]:
1717

1818
return result_list
1919

20+
21+
22+
class Solution:
23+
def productExceptSelf(self, nums: List[int]) -> List[int]:
24+
result_list = [0] * len(nums)
25+
if len(nums) <2 or len(nums) > 1e5:
26+
return None
27+
28+
for idx in range(0, len(nums)):
29+
result = 1
30+
for idx_left in range(0, idx):
31+
result *= nums[idx_left]
32+
33+
for idx_right in range(idx+1, len(nums)):
34+
result *= nums[idx_right]
35+
36+
result_list[idx] = result
37+
38+
39+
return result_list
40+

valid-palindrome/HYUNAHKO.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ def isPalindrome(self, s: str) -> bool:
99
if (str1 != result[n-i-1]):
1010
return False
1111
return True
12-
1312

0 commit comments

Comments
 (0)