|
|
|
|
|
by NiceGuy_Ty
3174 days ago
|
|
There was just a post on HN to a site that went over this exact problem. Essentially, you do two linear scans to calculate the product of every number before an index, and to calculate the product of every number after an index. Then, for each index, the answer is just multiplying those two numbers you found for that index. |
|