Arrays & HashingMedium
Product of Array Except Self
Return a list where position i holds the product of every number except nums[i]. Don't use division, and stay O(n).
Example 1nums = [2, 3, 4] → [12, 8, 6]
Example 2nums = [1, 0, 5] → [0, 5, 0]
2 ≤ n ≤ 10⁵ · every product fits in a 32-bit integer