【Leetcode】1672. Richest Customer Wealth
題目地址:
https://leetcode.com/problems/richest-customer-wealth/
給定一個二維陣列 A A A, A [ i ] A[i] A[i]代表客戶 i i i在各個銀行的資產。問總資產最多的客戶的總資產是多少。
直接統計。程式碼如下:
public class Solution {
public int maximumWealth(int[][] accounts) {
int res = 0;
for (int[] account : accounts) {
int asset = 0;
for (int i = 0; i < account.length; i++) {
asset += account[i];
}
res = Math.max(res, asset);
}
return res;
}
}
時間複雜度 O ( m n ) O(mn) O(mn), m m m是 A A A的行數, n n n是 A A A的列數,空間 O ( 1 ) O(1) O(1)。
相關文章
- Customer APIAPI
- R12 Unable To Query Customer With Partial 'Customer Account Number'
- SAP Cloud for Customer Account和individual customer的區別Cloud
- New World Wealth:俄羅斯貧富差距最大日本最小
- Wealth質押挖礦系統開發方案詳情
- SAP Cloud for Customer裡BusinessPartner, Customer和Employee這些BO的區別Cloud
- SAP Cloud for Customer的前世今生Cloud
- Customer Exit變數增強變數
- CUSTOMER INTERFACE STATUS ERROR CODESError
- 威爾士(Wealth)質押挖礦系統開發IDO
- 威爾士Wealth質押挖礦系統開發功能分析
- Wealth威爾士智慧合約挖礦系統開發技術
- Dependencies for Variables of Type Customer Exit [SAP Help]
- User Exits,Customer Exits,BAdI and BTE
- 威爾士2.0Wealth質押挖礦(系統技術開發)
- Wealth-X&BI:2016年全球富豪榜Top50
- 顧客細分(Customer Segmentation)(轉載)Segmentation
- BAdI: Customer-defined Functions in Formula BuilderFunctionORMUI
- New World Wealth:2019年全球財富遷移評估報告
- Wealth威爾士質押挖礦系統技術開發(詳情分析)
- 如何使用SAP Cloud for Customer裡的Data SourceCloud
- SAP Cloud for Customer 標準培訓課程Cloud
- 機器學習在SAP Cloud for Customer中的應用機器學習Cloud
- SAP Cloud for Customer Price-計價簡介Cloud
- SAP Cloud for Customer的CTI呼叫中心解決方案Cloud
- SAP Cloud for Customer的Mashup位於CustomPane裡Cloud
- SAP Cloud for Customer ABSL的一些優化Cloud優化
- SAP Cloud for Customer框架是如何使用JavaScript Promise的Cloud框架JavaScriptPromise
- 使用soapUI消費SAP Cloud for Customer的web serviceUICloudWeb
- How To Create a Tab in Customer Admin Edit in Magento 2 ?(轉)
- 威爾士(Wealth)質押挖礦系統技術開發DAPP/Defi/IDOAPP
- 使用Excel匯入資料到SAP Cloud for Customer系統ExcelCloud
- SAP Cloud for Customer的Container應用設計原理CloudAI
- SAP Cloud for Customer的Account Team裡的role如何配置Cloud
- SAP Cloud for Customer Extensibility的設計與實現Cloud
- Hybris ECP裡Customer對應的資料庫表資料庫
- 威爾士2.0(Wealth)質押挖礦/理財/分紅/系統開發技術設計
- 如何把SAP Kyma和SAP Cloud for Customer連線起來Cloud