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 7f64711 commit 7ab60dbCopy full SHA for 7ab60db
product-of-array-except-self/mangodm-web.py
@@ -0,0 +1,19 @@
1
+from typing import List
2
+
3
4
+class Solution:
5
+ def productExceptSelf(self, nums: List[int]) -> List[int]:
6
+ result = []
7
8
+ product = 1
9
+ for i in range(len(nums)):
10
+ result.append(product)
11
+ product *= nums[i]
12
13
14
15
+ for i in range(len(nums) - 1, -1, -1):
16
+ result[i] *= product
17
18
19
+ return result
0 commit comments