g1601_1700.s1672_richest_customer_wealth.Solution Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-java17 Show documentation
Show all versions of leetcode-in-java17 Show documentation
Java Solution for LeetCode algorithm problems, continually updating
package g1601_1700.s1672_richest_customer_wealth;
// #Easy #Array #Matrix #Programming_Skills_I_Day_6_Array
// #2022_04_23_Time_0_ms_(100.00%)_Space_44.1_MB_(7.31%)
public class Solution {
public int maximumWealth(int[][] accounts) {
int max = Integer.MIN_VALUE;
for (int[] account : accounts) {
int sum = 0;
for (int i : account) {
sum += i;
}
max = Math.max(max, sum);
}
return max;
}
}