All But Me (Arrays & Lists)

For every position in the list, print the product of all the other values. Try it without division.

Input: n (2 to 15), then n integers between -3 and 3.

Output: n products, space-separated.

Difficulty: Medium. Write your answer in the browser editor, run the examples, then submit it against hidden tests. Python and JavaScript are free; other languages are part of licode Club.

Hint

  • The answer at i is (product of everything left of i) × (product of everything right of i).

More Arrays & Lists practice