Skip to content

Commit 8fb26d6

Browse files
committed
Create do-heewan.py
1 parent ecc9a93 commit 8fb26d6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution:
2+
def productExceptSelf(self, nums: List[int]) -> List[int]:
3+
result = []
4+
5+
x = 1
6+
for element in nums:
7+
result.append(x)
8+
x *= element
9+
10+
x = 1
11+
for i in range(len(nums)-1, -1, -1):
12+
result[i] *= x
13+
x *= nums[i]
14+
15+
return result
16+

0 commit comments

Comments
 (0)