Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ce5c50a

Browse files
committed
1672
1 parent 55561d9 commit ce5c50a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

1672. Richest Customer Wealth.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @param {number[][]} accounts
3+
* @return {number}
4+
*/
5+
var maximumWealth = function (accounts) {
6+
richest = 0;
7+
for (i = 0; i <= accounts.length - 1; i++) {
8+
wealth = accounts[i][0];
9+
for (j = 1; j <= accounts[i].length - 1; j++) {
10+
wealth += accounts[i][j];
11+
}
12+
richest <= wealth ? (richest = wealth) : null;
13+
}
14+
return richest;
15+
};

0 commit comments

Comments
 (0)