Advertisement
Guest User

Problem

a guest
Sep 17th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*This problem was asked by Uber.
  2.  
  3. Given an array of integers,
  4. return a new array such that each element at index i of the new array
  5. is the product of all the numbers in the original array except the one at i.
  6.  
  7. For example,
  8. if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24].
  9. If our input was [3, 2, 1], the expected output would be [2, 3, 6].
  10.  
  11. Follow-up: what if you can't use division?*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement