Product of Array Except Self

MEDIUM|

Compute prefix products in one forward pass and suffix products in a backward pass without division. Space: O(1) extra auxiliary.