Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 375 Bytes

README.md

File metadata and controls

10 lines (7 loc) · 375 Bytes

<< [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]