标签:return least code size ++ pre ast cto color
class Solution { public: int leastBricks(vector<vector<int>>& wall) { unordered_map<int,int> m; for (int i = 0; i < wall.size(); i++) for (int j = 0, t = 0; j < wall[i].size() - 1; j++) { t += wall[i][j]; m[t]++; } int _max = 0; for (auto & p : m) { _max = max(_max, p.second); } return wall.size() - _max; } };
标签:return least code size ++ pre ast cto color
原文地址:https://www.cnblogs.com/JTechRoad/p/9110427.html