Richest Customer Wealth
给一个2d数组, 里面每组数据表示不同人的不同钱, 问最富的多少钱.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
class Solution { public int maximumWealth(int[][] accounts) { int res = 0; for(int[] a : accounts){ int tmp = 0; for(int i = 0; i < a.length; i++) { tmp += a[i]; } res = Math.max(res, tmp); } return res; } } |