Skip to content

Commit 131a270

Browse files
committed
--update: added test cases
1 parent 754fa31 commit 131a270

File tree

1 file changed

+8
-0
lines changed
  • src/_Problems_/product-of-elements

1 file changed

+8
-0
lines changed

src/_Problems_/product-of-elements/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
// An array such that each index has a product of all the numbers in the array except the number stored at that index.
22

3+
/**
4+
* Input - [1, 2, 3, 4]
5+
* Output - [24, 12, 8, 6]
6+
*
7+
* Input - [0, 1, 3, 5]
8+
* Output - [15, 0, 0, 0]
9+
*/
10+
311
function findProduct(arr) {
412
let left = 1;
513
const result = [];

0 commit comments

Comments
 (0)