We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55561d9 commit ce5c50aCopy full SHA for ce5c50a
1672. Richest Customer Wealth.js
@@ -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