package leetcode;

/**
 * https://leetcode.com/problems/richest-customer-wealth/
 */
public class Problem1672 {
    public int maximumWealth(int[][] accounts) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1672 prob = new Problem1672();
        System.out.println(prob.maximumWealth(new int[][]{{1,2,3},{3,2,1}})); // 6
        System.out.println(prob.maximumWealth(new int[][]{{1,5},{7,3},{3,5}})); // 10
        System.out.println(prob.maximumWealth(new int[][]{{2,8,7},{7,1,3},{1,9,5}})); // 17
    }
}

@@ -12,16 +12,42 @@
 tcode;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * h
@@ -192,392 +192,166 @@
     
-// TODO%0A        return 0;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1672 prob = new Problem1672();%0A        System.out.println(prob.maximumWealth(new int%5B%5D%5B%5D%7B%7B1,2,3%7D,%7B3,2,1%7D%7D)); // 6%0A        System.out.println(prob.maximumWealth(new int%5B%5D%5B%5D%7B%7B1,5%7D,%7B7,3%7D,%7B3,5%7D%7D)); // 10%0A        System.out.println(prob.maximumWealth(new int%5B%5D%5B%5D%7B%7B2,8,7%7D,%7B7,1,3%7D,%7B1,9,5%7D%7D)); // 17
+int answer = 0;%0A        for (int%5B%5D account : accounts) %7B%0A            answer = Math.max(answer, Arrays.stream(account).sum());%0A        %7D%0A        return answer;
 %0A   

Solve problem 1672