You are given an m x n grid `accounts` where `accounts[i][j]` is the money customer i keeps in bank j. A customer's wealth is the total across all of their banks. Return the wealth of the richest customer.
You are given an m x n grid accounts where accounts[i][j] is the money customer i keeps in bank j. A customer's wealth is the total across all of their banks. Return the wealth of the richest customer.
Example 1:
Input: {"accounts":[[1,2,3],[3,2,1]]}
Output: 6
Constraints:
m==accounts.length
n==accounts[i].length
1≤m,n≤50
1≤accounts[i][j]≤100
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"accounts":[[1,2,3],[3,2,1]]}
best starts at 0. We will total each of the 2 customers and keep the largest total.