Skip to content

Commit 0dd37dc

Browse files
author
Joseph Luce
authored
Update 238_product_of_array_except_self.md
1 parent 3eb0b1b commit 0dd37dc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

leetcode/medium/238_product_of_array_except_self.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
The idea is to calculate the products going from left to right, then again going right to left.
99
Storing these calculations as two arrays will allow one last calculation to find the products from the left and right for each number.
1010

11+
```
12+
For example:
13+
Input: [1,2,3,4]
14+
Left Array: [1,1,2,6]
15+
Right Array: [24,12,4,1]
16+
Result: [24,12,8,6]
17+
```
18+
1119
```
1220
class Solution:
1321
def productExceptSelf(self, nums: List[int]) -> List[int]:

0 commit comments

Comments
 (0)