All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g1601_1700.s1672_richest_customer_wealth.Solution Maven / Gradle / Ivy

There is a newer version: 1.24
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy