Moin. Ich wollte wissen, was in der äußeren for Schleife bei
Hier einmal der ganze Code
sum
gespeichert wird, da in der inneren for Schleife ja sum+=accounts[i][j]
steht.Hier einmal der ganze Code
Java:
class Solution {
public int maximumWealth(int[][] accounts) {
int max = 0;
int sum;
for(int i = 0; i < accounts.length; i++){
sum = 0;
for(int j = 0; j <accounts[i].length;j++){
sum += accounts[i][j];
}
if(sum > max){
max = sum;
}
}
return max;
}
}