LeetCode 238 Product of Array Except Self - Problem Statement

The problem

Given an integer array nums, return an array answer such that answer[i] equals the product of all elements of nums except nums[i]. You cannot use the division operator.

With nums = [1, 2, 3, 4], the answer is [24, 12, 8, 6]. For index 0, the product is 2 × 3 × 4 = 24. For index 1, it's 1 × 3 × 4 = 12. And so on.

Without division, how can you compute each product without recalculating from scratch?

Constraints: 2n1052 \le n \le 10^5, values from 30-30 to 3030.