Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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‎

Lines changed: 8 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /