Wealthiest Customer

A customer may have money in several banks, so their total wealth is the sum across all accounts. Given a matrix accounts, where each row represents one customer and the numbers in that row are their balances in different banks, find the largest total wealth. Return that maximum amount.

Примеры

Ввод
[[1, 2, 3], [3, 2, 1]]
Вывод
6
Ввод
[[1, 5], [7, 3], [3, 5]]
Вывод
10
Ввод
[[2, 8, 7], [7, 1, 3], [1, 9, 5]]
Вывод
17

Нужно реализовать

def maximum_wealth(accounts: list[list[int]]) -> int:

Теги

arraymath
PostgreSQLv16

Тук ще се появи резултатът от изпълнението на кода

Visible tests
1
Input
[[1,2,3],[3,2,1]]
Expected6
2
Input
[[1,5],[7,3],[3,5]]
Expected10
3
Input
[[2,8,7],[7,1,3],[1,9,5]]
Expected17
4
Input
[[10]]
Expected10
5
Input
[[1,1],[1,1]]
Expected2
6
Input
[[1,2,3],[3,2,1],[1,2,3]]
Expected6
Focus radio
Paused · SomaFM · Fluid