OneCompiler

maximum array in 2d array

198
  • @param {number} accounts * @return {number}

var maximumWealth = function(accounts) { var max=0; for(var i=0;i<accounts.length; i++)

{

var row=0;

for(var j=0;j<accounts[i].length; j++)

{

row row+accounts[i][j];

}

if(row>max)

{

max=row;

}

I

}

return max;

};