Pergunta de entrevista da empresa Amazon

Given array of numbers [S1, S2, ...Sn], calculate the result array R whose Ri=S1*..S[i-1]*S[i+1]*...*Sn. Require 2 solutions.

Resposta da entrevista

Sigiloso

25 de mai. de 2012

Let N be the product of all the numbers. Now make an array A[i] = N / S[i].