We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af92506 commit 90bea1dCopy full SHA for 90bea1d
product-of-array-except-self/yyyyyyyyyKim.py
@@ -0,0 +1,16 @@
1
+class Solution:
2
+ def productExceptSelf(self, nums: List[int]) -> List[int]:
3
+
4
+ answer = [1]*len(nums)
5
6
+ left = 1
7
+ for i in range(len(nums)):
8
+ answer[i] *= left
9
+ left *= nums[i]
10
11
+ right = 1
12
+ for i in range(len(nums)-1,-1,-1):
13
+ answer[i] *= right
14
+ right *= nums[i]
15
16
+ return answer
0 commit comments