Leetcode in Java && Oracle
421 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-10-20_03-12-01.png
35.7 KB
#N1672. Richest Customer Wealth
problem link=>https://leetcode.com/problems/richest-customer-wealth/

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