Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

<< [02] Product of every other number in an array >>

Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i. Solve it without using division and in O(n).

Example:

>>> coding_problem_02([1, 2, 3, 4, 5])
[120, 60, 40, 30, 24]