Easy Problems

1672. Richest Customer Wealth

Solutions

function maximumWealth(accounts: number[][]): number {
  let max = 0;
  for(let i = 0; i < accounts.length; i++) {
    let temp = 0;
    for(let j = 0; j < accounts[i].length; j++) {
        temp += accounts[i][j];
    }
 
    if(temp > max) max = temp;
  } 
  return max;
};
Last Update: 12:08 - 16 April 2024
Array
String

On this page