Product of Array Except Self
Return an array output where output[i] is the product of every element except nums[i]. The catch that makes it interesting: solve it without division (so a zero in the array doesn't break you) and in O(n).
The trick: output[i] = (product of everything to the left of i) × (product of everything to the right of i). Two passes, a prefix pass, then a suffix pass.
productExceptSelf([1, 2, 3, 4]); // [24, 12, 8, 6]
productExceptSelf([-1, 1, 0, -3, 3]); // [0, 0, 9, 0, 0]