Menu
CoddyTech

Richest Customer Wealth

一家银行有一个 accounts 网格,其中有 m 行,每行对应一位客户;有 n 列,每列对应一家银行:accounts[i][j] 表示客户 i 在银行 j 持有的钱。一位客户的财富是其所在行的总和。返回最富有客户的财富。

函数

maximumWealth(accounts: integer-2d-array) → integer
accountsinteger-2d-array
余额网格,每位客户占一行,每家银行占一列
返回值integer
最大的行总计

约束条件

  • 1 ≤ accounts.length ≤ 100
  • 1 ≤ accounts[i].length ≤ 100,并且每一行的长度都相同。
  • 0 ≤ accounts[i][j] ≤ 104

示例

输入
accounts = [[2, 8, 1], [5, 5, 4], [7, 0, 3]]
输出
14
解释
各行的总和分别是 11、14 和 10。中间那位客户最富有,总额为 14,尽管最大的单笔余额 8 属于其他人。
重置代码
def maximumWealth(accounts):
    # 在这里编写代码

测试 #1

测试 #2

参数

accounts = [[2, 8, 1], [5, 5, 4], [7, 0, 3]]

预期输出

14