/**
* @param {number[]} A
* @return {number[]}
*/
var multiply= function(a) {
const res =[];
let left = new Array(a.length).fill(1);
let right = new Array(a.length).fill(1);
for(let i=1;i<a.length;i++){
left[i] = a[i-1] * left[i-1];
}
for(let j=a.length-2;j>=0;j--){
right[j] = a[j+1] * right[j+1];
}
for(let k=0;k<a.length;k++){
res[k] = left[k] * right[k];
}
// console.log(left)
// console.log(right)
return res;
};