Answers for "1672. Richest Customer Wealth leetcode solution in c++"

C++
0

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;
    }
};
Posted by: Guest on March-10-2022

Code answers related to "1672. Richest Customer Wealth leetcode solution in c++"

Browse Popular Code Answers by Language