Skip to content

Files

Latest commit

9b3e14c · Apr 15, 2019

History

History
14 lines (9 loc) · 676 Bytes

File metadata and controls

14 lines (9 loc) · 676 Bytes

Problem #2 [Hard]

Problem Description

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.

Implementation

My solution generates the result array by sweeping through the source array twice, which means it falls under time complexity of O(n), where n is the number of elements in the source array.