Array Problem In Javascript
Anonymous
given an array of integers, return an output array such that output[i] is equal to the product of all the elements in the array other than itself
for example :
var firstArray = [2, 2, 4, 1]; // o/p: [8, 8, 4, 16] var secondArray = [0, 0, 0, 2];o/p: [0, 0,0,0] var thirdArray = [-2, -2, -3, 2]; 0/P: [12, 12, 8, -12]
What should be the approach for this kind of problem?