Back to exercises

Product of Array Except Self

First store prefix products from the left, then multiply each position by a running suffix product from the right.

Coding Exercises Medium O(n)

Product of Array Except Self

First store prefix products from the left, then multiply each position by a running suffix product from the right.

Return an array where each position contains the product of all other elements except itself.