Product of Array Except Self (LC #238) appears constantly at Meta. The twist: no division allowed. Build prefix products from the left in one pass. Then multiply by suffix products from the right in a second pass. For position , the answer is prefix[] times suffix[]. You can optimize to extra space by using the output array for prefixes and a running variable for suffixes. Runs in time. Meta asks follow-ups about handling zeros. If one zero exists, only that position has a non-zero product.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/meta-interview-prep/arrays-strings/product-of-array-except-self
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████████████████████████████████████████████████████████████████████████████████████████████