(leetcode) richest-customer-wealth , Java풀이

문제 : https://leetcode.com/problems/richest-customer-wealth/submissions/

class Solution {
    public int maximumWealth(int[][] accounts) {
        int maxi= 0;
        for(int i=0 ; i<accounts.length ; i++) {
            int sum = 0;
            for(int j=0 ; j<accounts[i].length ; j++) {
                sum += accounts[i][j];
            }
            maxi = Math.max(maxi,sum);
        }
        return maxi;
    }

}

좋은 웹페이지 즐겨찾기