Product of Array Except Self
Return a list answer where answer[i] is the product of every number in nums except nums[i].
Try to do it without using division.
Example 1
nums [1,2,3,4]
returns [24,12,8,6]
For index 0: 2*3*4 = 24. For index 3: 1*2*3 = 6.
Example 2
nums [2,0,5]
returns [0,10,0]
Only the index holding 0 gets a nonzero product: 2*5 = 10.
Constraints
2 <= len(nums) <= 20-10 <= nums[i] <= 10
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.