Input: nums = [-1,1,0,-3,3]
Output: [0,0,9,0,0]
Explanation: Every position except index 2 has a zero among the other elements, so those products are 0; result[2] = (-1)*1*(-3)*3 = 9.
Constraints
2≤nums.length≤105
−30≤nums[i]≤30
The input is generated such that the product of any prefix or suffix of nums (and every entry of the answer) fits in a 32-bit signed integer.
Loading editor...
Log in to run your code. Your draft is saved in this browser.Log inSign up