Leetcode_1672_最富有客户的资产总量_模拟

12/12

水题
class Solution {
    
    
    public int maximumWealth(int[][] accounts) {
    
    
        int m=accounts.length;;
        int n=accounts[0].length;
        int ans=0;
        for(int i=0;i<m;i++) {
    
    
            int temp=0;
            for (int j = 0; j < n; j++) {
    
    
                temp+=accounts[i][j];
            }
            ans=Math.max(temp,ans);
        }
        return ans;
    }
}

猜你喜欢

转载自blog.csdn.net/HDUCheater/article/details/111062397