Trains the technique from
LeetCode 1672Richest Customer WealthThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A wholesaler runs several depots and carries the same set of product lines in each of them. stock[d][p] is the number of units of product line p sitting in depot d.
A depot's holding is the number of units it has across all of its product lines added together.
Return the largest holding of any single depot.
Example 1
Depot 0 holds 18 units, depot 1 holds 12 and depot 2 holds 22, so the largest holding is depot 2's.
Example 2
Depot 0 holds 101 units and depot 1 holds 99.
Example 3
Both depots hold ten units in total, so that figure is what comes back.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def busiest_depot_total(stock: list[list[int]]) -> int:public int busiestDepotTotal(int[][] stock)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.