Given an array of numbers, return a new array where result[i] is the product of every element EXCEPT nums[i]. Each position is excluded from its own product.
For a 10-element array that's 90 multiplications — tolerable. But arrays in production can have 100,000 elements. The quadratic explosion means roughly 10 billion operations — a timeout on any judge. The question isn't whether brute force works (it does), but whether we can do better. Watch the exclusion pattern play out on a small array first.
The brute force does this in O(n²) — one nested loop per cell. The goal is O(n). But there is a catch: the problem forbids division. That constraint is not arbitrary — it is there because division breaks in a way that will surprise you.