Skip to content

Commit d98b72b

Browse files
committed
Update ProdArrayExceptSelf.py
1 parent 9788b90 commit d98b72b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

LeetCode/ArraysAndHashing/ProdArrayExceptSelf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def productExceptSelf(self, nums: List[int]) -> List[int]:
1313
rightProd[len(nums) - 1]= 1 #since nums[-1] has nothing to the right of it we put 1
1414

1515
for i in range (1, len(nums)):
16-
leftProd[i] = leftProd[i-1] * nums
16+
leftProd[i] = leftProd[i-1] * nums[i-1]
1717

1818
rightProd[len(nums)- i -1] = rightProd[len(nums)-i] * nums[len(nums)-i] #multiplies every element to the right of i
1919

0 commit comments

Comments
 (0)