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
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisäänVisible tests
1
Input
[[1,2,3],[3,2,1]]Expected
62
Input
[[1,5],[7,3],[3,5]]Expected
103
Input
[[2,8,7],[7,1,3],[1,9,5]]Expected
174
Input
[[10]]Expected
105
Input
[[1,1],[1,1]]Expected
26
Input
[[1,2,3],[3,2,1],[1,2,3]]Expected
6Focus radio
Paused · SomaFM · Fluid