Problem statement
For every position, build the product of all the other values in the array.
Division is not allowed. The answer must stay correct when the array holds zeros or negative values.
Examples
Inputa = [1, 2, 3, 4]
Output[24, 12, 8, 6]
Cell 2 multiplies the left product 2 with the right product 4.
Inputa = [1, 2, 0, 4]
Output[0, 0, 8, 0]
Only the zero's own position escapes the zero, and it answers 8.
The walkthrough is part of Premium
The statement and the examples above stay free. The full how-to-solve walkthrough, the cost notes in plain words and the interactive step-by-step visualizer unlock with a Premium plan.
See pricing