Return copy of array, each element product of all others, constant additional space, no division
A variation of a solution left by a commenter called Vince
Given input $a = &lt;a_1, ..., a_n&gt;$.

Allocate result array $b = &lt;b_1, \ldots, b_n&gt;$. Set $product = 1$.
For $i \in [1, n]$, set $b_i = product$ and set $product = product * a_i$.
Set $product = a_n$. For $i \in [n - 1, 1]$, set $b_i = b_i * product$, and set $product = product * a_i$.
Return the array $&lt;b_1, \ldots, b_n&gt;$.

This solution runs in $O(n)$ time and $O(1)$ space additional to that allocated for the result.