Skip to content

Commit c64edc7

Browse files
add 1672
1 parent ddb366b commit c64edc7

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|-----|----------------|---------------|--------|-------------|-------------
11+
|1672|[Richest Customer Wealth](https://leetcode.com/problems/richest-customer-wealth/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1672.java) ||Easy|Array|
1112
|1669|[Merge In Between Linked Lists](https://leetcode.com/problems/merge-in-between-linked-lists/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1669.java) ||Medium|LinedList|
1213
|1668|[Maximum Repeating Substring](https://leetcode.com/problems/maximum-repeating-substring/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1668.java) ||Easy|String|
1314
|1664|[Ways to Make a Fair Array](https://leetcode.com/problems/ways-to-make-a-fair-array/)|[Javascript](./javascript/_1664.js) ||Medium|Greedy|
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _1672 {
4+
public static class Solution1 {
5+
public int maximumWealth(int[][] accounts) {
6+
int m = accounts.length;
7+
int n = accounts[0].length;
8+
int max = 0;
9+
for (int i = 0; i < m; i++) {
10+
int sum = 0;
11+
for (int j = 0; j < n; j++) {
12+
sum += accounts[i][j];
13+
}
14+
max = Math.max(max, sum);
15+
}
16+
return max;
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)