You are given an integer array nums.
Your task is to compute an array answer where each answer[i] represents the product of all elements in nums excluding nums[i].
Return the array answer.
[1, 2, 3]
[6, 3, 2]
For nums[0]=1, the product of elements except self is 23 = 6. For nums[1]=2, the product of elements except self is 13 = 3. For nums[2]=3, the product of elements except self is 1*2 = 2.
[0, 1, 2]
[2, 0, 0]
For nums[0]=0, the product of elements except self is 12 = 2. For nums[1]=1, the product of elements except self is 02 = 0. For nums[2]=2, the product of elements except self is 0*1 = 0.
[1, 2, 3]
[6, 3, 2]