6-10PM challenge problem #002

akbhairwal

akbhairwal

Posted on September 25, 2019

6-10PM challenge problem #002

Array of Array Products

There is an array 'arr' of Integers of size n, for every index i (from 0 to n) you can calculate product of all element integers except that element.
Solve without using division and analyze your solution’s time and space complexities.

Examples:

input: arr = [8, 10, 2]
output: [20, 16, 80] # by calculating: [10*2, 8*2, 8*10]

input: arr = [2, 7, 3, 4]
output: [84, 24, 56, 42] # by calculating: [7*3*4, 2*3*4, 2*7*4, 2*7*3]

Solution

💖 💪 🙅 🚩
akbhairwal
akbhairwal

Posted on September 25, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

6-10PM challenge problem #002
challenge 6-10PM challenge problem #002

September 25, 2019

6-10PM challenge problem #001 solution
challenge 6-10PM challenge problem #001 solution

September 25, 2019

6-10PM challenge problem #001
challenge 6-10PM challenge problem #001

September 24, 2019