You are given a 2D grid accounts of size m x n, where accounts[i][j] represents how much money the i-th customer keeps in the j-th bank account.
The wealth of any customer is the sum of all values in their row.
Your goal is to identify the customer with the maximum total wealth and return that value.
Input: accounts = [[2,4,1],[5,3,2]]
Output: 10
Explanation:
Customer wealths → 7 and 10. Maximum wealth = 10.
Input: accounts = [[10,0],[3,3],[2,8]]
Output: 10
Explanation:
Wealths → 10, 6, 10. Highest wealth = 10.
Input: accounts = [[1,1,1],[9,0,0],[4,4,1]]
Output: 9
Explanation:
Customer wealths → 3, 9, 9. Richest = 9.
Accepted:
Submission: