π One-stop destination for all your technical interview Preparation π
You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the iβββββββββββthββββ customer has in the jβββββββββββthββββ bank. Return the wealth that the richest customer has.
A customerβs wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that has the maximum wealth.
class Solution {
public:
int maximumWealth(vector<vector<int>>& accounts) {
int ans = 0;
for(auto &x:accounts){
int temp = accumulate(x.begin(),x.end(),0);
ans = max(temp,ans);
}
return ans;
}
};