Challenge: Array of Products of All Elements
Has a incorrect example image.
for input [4,2,1,5,0] > output will be [10, 20, 40, 8, 40] but currently it is [0,0,0,0,40]
Has a incorrect example image.
Hi @Samrat_Saha !!
Problem: Implement a function called findProduct(arr)
that takes an array of integers as input and modifies it so that each index stores the product of all the numbers in the array except the number at that index. The function should return the modified array.
For example, given the input [4, 2, 1, 5, 0]
, the function should modify the array as follows:
2 * 1 * 5 * 0 = 0
4 * 1 * 5 * 0 = 0
4 * 2 * 5 * 0 = 0
4 * 2 * 1 * 0 = 0
4 * 2 * 1 * 5 = 40
Therefore, the expected output for the input [4, 2, 1, 5, 0]
is [0, 0, 0, 0, 40]
.
I hope it helps. Happy Learning