public int MaximumWealth(int[][] accounts) { int yLen = accounts.Length; int max = 0; for(int y = 0; y < yLen; y++) { //取得 x 位置的長度 int xLen = accounts[y].Length; //目前客戶 int currentCustom = 0; //計算目前客戶財產 for(int x = 0; x < xLen; x++) { //目前格子 int cell = accounts[y][x]; currentCustom += cell; } //判斷目前最有錢的客戶 if (max <= currentCustom) max = currentCustom; } return max; }