https://leetcode.com/problems/brick-wall/description/
class Solution {
public:
int leastBricks(vector<vector<int>>& wall) {
map<int, int> hash;
int maxcnt = 0;
for(int i=0; i<wall.size(); i++){
int sum = 0;
for(int j=0; j<wall[i].size()-1; j++){
sum += wall[i][j];
++hash[sum];
}
}
for(auto it:hash) maxcnt = max(maxcnt, it.second);
return wall.size() - maxcnt;
}
};