Skip to content

Commit 0bb3198

Browse files
committed
Product Of Array Except Self
1 parent 2634356 commit 0bb3198

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Arrays/238-product-of-array-except-self.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
'''Leetcode - https://leetcode.com/problems/product-of-array-except-self/'''
2+
'''
3+
Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].
4+
5+
The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
6+
7+
You must write an algorithm that runs in O(n) time and without using the division operation.
8+
9+
Input: nums = [1,2,3,4]
10+
Output: [24,12,8,6]
11+
'''
212

313
# Solution
414
def productExceptSelf(nums):

0 commit comments

Comments
 (0)