Product of Array Except Self

Medium
ArrayPrefix ProductGoogleMeta
For each index, compute the product of every array value except the value at that index. Input format: - First line: n - Second line: n integers Print n integers on one line.

Constraints

2 <= n <= 10^5
-30 <= nums[i] <= 30
The answer for each index fits in a signed 64-bit integer.

Sample tests

Sample 1

Sample 2

Sign in to submit