1672. Richest Customer Wealth 發表於 2023-02-13 | 分類於 leetcode problemsolution123456789101112class Solution {public: int maximumWealth(vector<vector<int>>& accounts) { int mx = 0, n= accounts.size(); for(int i=0;i<n;++i){ int temp = 0; for(auto a:accounts[i]) temp+=a; mx = max(mx, temp); } return mx; }}; analysis time complexity O(nm) space complexity O(1)