Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

1672. Richest Customer Wealth leetcode solution in c++

class Solution {
public:
    int maximumWealth(vector<vector<int>>& accounts) {
        int ans=0;
        int sum=0;
        for(int i=0;i<accounts.size();i++)
        {
            for(int j=0;j<accounts[i].size();j++)
            {
               sum+=accounts[i][j];
            }
            ans=max(ans,sum);
            sum=0;
        }
        return ans;
    }
};
Source by codejudge.blogspot.com #
 
PREVIOUS NEXT
Tagged: #Richest #Customer #Wealth #leetcode #solution
ADD COMMENT
Topic
Name
5+8 =