LeetCode 238 Product of Array Except Self - Why Naive Fails

The trap

For each index, multiply all other elements.

Each product computation takes O(n)O(n). With nn positions, that's O(n2)O(n^2) total.

For n=105n = 10^5, that's 101010^{10} operations. Too slow.