#1672

Donghee Choi·2023년 1월 18일

leetcode

목록 보기
11/13

1672. Richest Customer Wealth

내 답안

/**
 * @param {number[][]} accounts
 * @return {number}
 */
var maximumWealth = function(accounts) {
  let max = 0;
  accounts.forEach((account) => {
    max = Math.max(
      account.reduce((acc, item) => {
        return acc + item;
      }, 0),
      max
    );
  });

  return max;
};
profile
frontend, vuejs, react, docker, kubernetes

0개의 댓글