Published:
Updated:

https://leetcode.com/problems/richest-customer-wealth/


Solution

class Solution {
    static int maximumWealth(int[][] accounts) {
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < accounts.length; i++) {
            int tmp = 0;
            for (int j = 0; j < accounts[i].length; j++) {
                tmp += accounts[i][j];
            }

            if (tmp > max) {
                max = tmp;
            }
        }

        return max;
    }
}

Leave a comment