Given an array of integers numbers
, return a new array result
where each element result[i]
represents the product of all the elements in numbers
except for numbers[i]
.
numbers: number[]
: An array of integersnumbers
array is ensured to fit within a 32-bit integerInput: numbers = [1,2,3]Output: [6,3,2]Explanation: Output is multiplication of all other elements except self, i.e 2*3, 1*3, 1*2
Input: numbers = [2,0,3]Output: [0,6,0]Explanation: Output is multiplication of all other elements except self, i.e 0*3, 2*3, 2*0
Input: numbers = [0,0,-1,1]Output: [0,0,0,0]Explanation: Output is multiplication of all other elements except self, i.e 0*-1*1, 0*-1*1, 0*0*1, 0*0*-1
numbers.length
<= 1000numbers[i]
<= 10Given an array of integers numbers
, return a new array result
where each element result[i]
represents the product of all the elements in numbers
except for numbers[i]
.
numbers: number[]
: An array of integersnumbers
array is ensured to fit within a 32-bit integerInput: numbers = [1,2,3]Output: [6,3,2]Explanation: Output is multiplication of all other elements except self, i.e 2*3, 1*3, 1*2
Input: numbers = [2,0,3]Output: [0,6,0]Explanation: Output is multiplication of all other elements except self, i.e 0*3, 2*3, 2*0
Input: numbers = [0,0,-1,1]Output: [0,0,0,0]Explanation: Output is multiplication of all other elements except self, i.e 0*-1*1, 0*-1*1, 0*0*1, 0*0*-1
numbers.length
<= 1000numbers[i]
<= 10console.log()
statements will appear here.