The purpose is to find a col with most edges.First I choose **Array[i]**, which **i** means the numbers of edges in col[i].But it cause **OOM**, so I change to **Map**.

```
public class Solution {
public static int leastBricks(List<List<Integer>> wall) {
HashMap<Integer,Integer> map = new HashMap<Integer,Integer>();//<edge,num>
for(List<Integer> rows : wall){
int edge = 0;
for(int brick : rows){
if(edge != 0)
map.put(index,map.getOrDefault(edge,0) + 1);
edge += brick;
}
}
int max = 0;
for(int m : map.values()){
max = Math.max(max, m);
}
return wall.size() - max;
}
}
```