Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].
  2.  
  3. Example:
  4.  
  5.  
  6. Input: [1,2,3,4]
  7.  
  8. Output: [24,12,8,6]
  9.  
  10. Note: Please solve it without division and in O(n).
  11.  
  12. Follow up:
  13.  
  14. Could you solve it with constant space complexity? (The output array does not count as extra space for the purpose of space complexity analysis.)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement