← 返回 amazon 的题目列表Product of Array Except Self
类型:online_judge
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]. The product should be computed without using division and in O(1) extra space complexity. Note: The length of nums is between 1 and 10^5, and each element can range from -30 to 30. It's guaranteed that the answer will fit in a 32-bit integer.
Example:
Input: nums = [1,2,3,4] Output: [24,12,8,6]
Example
Input
1
2
3
4