Skip to content

Commit d4abec4

Browse files
committed
✨ richest customer wealth
1 parent 2fd9d84 commit d4abec4

File tree

1 file changed

+13
-0
lines changed
  • src/1672-richest-customer-wealth

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @param {number[][]} accounts
3+
* @return {number}
4+
*/
5+
var maximumWealth = function (accounts) {
6+
let res = 0;
7+
for (let arr of accounts) {
8+
const sum = arr.reduce((acc, n) => acc + n, 0);
9+
res = Math.max(res, sum);
10+
}
11+
12+
return res;
13+
};

0 commit comments

Comments
 (0)