Product Of Array Except Itself Without Using Division Operator
easy
1. Given an integer array of size 'n'. 2. Return an array answer such that answer[i] is equal to the product of all the elements of arr except arr[i]. 3. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
Constraints
1. 2 <= arr.length <= 10^5 2. -30 <= arr[i] <= 30 3. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
Format
Input
N -> size of array. N distinct elements n0 n1, n2, . , . , . nN.
Output
print Final res
Example
Sample Input
4
1 2 3 4
Sample Output
24 12 8 6