Richest Customer Wealth

Easy

accounts[i][j] is the amount of money customer i has in bank j. Return the wealth of the richest customer, where wealth is the sum of their row.

Example 1

maximumWealth()
Input
accounts = [[1,2,3],[3,2,1]]
Output
6

Why

Both customers have 6.

Example 2

maximumWealth()
Input
accounts = [[1,5],[7,3],[3,5]]
Output
10
Constraints
1 <= accounts.length, accounts[i].length <= 50
1 <= accounts[i][j] <= 100

Topics

ArraysMatrix

Implement maximumWealth in the editor and return the answer — printing it is never graded.