Skip to content

Commit a1707ad

Browse files
Solve : Product of Array Except Self
1 parent 26d68fc commit a1707ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def productExceptSelf(self, nums):
3+
ans = []
4+
for i in range(len(nums)):
5+
product = 1
6+
for j in range(len(nums)):
7+
if j != i:
8+
product *= nums[j]
9+
ans.append(product)
10+
return ans

0 commit comments

Comments
 (0)