Loading the journal
Loading the journal
Row Sum + Running Max
2 in the last 6 months
Community-reported company tags from leetcode-company-wise-problems (updated 2026-10-08). Bar shows how often each company asks it.
Problem
You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the ith customer has in the jth bank.
Return the wealth that the richest customer has. A customer's wealth is the total amount of money they have in all their bank accounts.
Input: accounts = [[1,2,3],[3,2,1]]
Output: 6
Explanation: Both customers have wealth 6.
Input: accounts = [[1,5],[7,3],[3,5]]
Output: 10
Input: accounts = [[2,8,7],[7,1,3],[1,9,5]]
Output: 17
m == accounts.length
n == accounts[i].length
1 ≤ m, n ≤ 50
1 ≤ accounts[i][j] ≤ 100
Reading the solution first feels like progress, but it makes the next similar problem — and the interview version — much harder, because you skipped the part where you figure it out. Give it an honest 20–30 minutes. Stuck? Re-read the pattern, watch the concept video, or try the brute force first.
Hidden: approach · solution code