In e-commerce recommendation models like Naive Bayes, calculating the combined probability of "all other items EXCEPT this one" is required to find conditional independence. If the array contains probability scores, division is mathematically risky due to floating point zeroes. We need to compute the product of all elements except 'i' without using division.
Given an integer array `nums`, return an array `answer` such that `answer[i]` is equal to the product of all the elements of `nums` except `nums[i]`. You must write an algorithm that runs in O(N) time and without using the division operation.
βΆ Run Code to test against examples Β· Submit to judge all 5 test cases