Algorithm · Asana · Medium
Given an integer array nums with length n, construct and return an array answer of the same length. For every index i, answer[i] must equal the product of all values in nums, omitting nums[i] itself. The implementation must not use division. It must run in $$O(n)$$ time and should keep extra space usage to $$O(1)$$ beyond the returned answer array. The output must remain correct when nums contains negative numbers, exactly one zero, multiple zeros, or no zeros. For n == 0,…
Checking your access…