Given an array of integers, return a new array where each element is the product of all the other elements, without using division and in O(n) time.
Example 1
Explanation: Each output value is the product of the other three, e.g. index 0's answer 24 = 2*3*4.
Example 2
Explanation: Every index except the zero's own position multiplies in that 0, forcing those results to 0; only index 2 (the zero itself) excludes it and gets the product of the rest.
Example 3
Explanation: With no zeros, the left/right running products alone reconstruct each answer correctly regardless of sign.
Code execution is coming soon.