Skip to main content
mediumBlind 75

Product of Array Except Self

Given an integer array nums Return an array where answer[i] is the product of all elements except nums[i] Must run in O(n) time without using division Example: [1,2,3,4] => [24,12,8,6]

At its core, Product of Array Except Self rewards a simple data-structure choice over clever math. Interviewers love it because it reveals your data-structure instincts and your edge-case discipline. Watch your edge cases around repeats, and be clear about what your map is storing.

Arrays & Hashing

Meet Coco

Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Typing with Coco is free when you sign in, up to a daily limit. Talking with her out loud comes with the $79 pack. Anyone can open the editor and run their code.

1Product Except Selfmedium
2Part 2

Each locked part opens in the editor once the part before it passes.

Based onLeetCode