34. Product of Array Except Self
MediumArrays & hashing
Return an array where element i is the product of every element of nums except nums[i]. Do not use division, and aim for O(n) time.
Example 1
Input: nums = [1, 2, 3, 4] Output: [24, 12, 8, 6]
Constraints
2 ≤ nums.length ≤ 10⁵Products fit in a 32-bit integer