Counter
Great use of Counter. One thing that can be improved, is to use most_common instead of max.
If edges is the Counter of all the edges in the wall, _, max_edges = edges.most_common(1) gives you the index with the most edges, and how many edges it has. Since this is the right side of the wall, you need the 2nd most common element: edges.most_common(2)[1]
aggregating the counter
Python is batteries included. Whenever you want to do advanced iteration, it can pay to look at the itertools module. For this, you can use accumulate (as @sedsarq notes in his answer) and chain.
edges = collections.Counter(
chain.from_iterable(accumulate(row) for row in wall)
)
def least_bricks2(wall):
edges = collections.Counter(
chain.from_iterable(accumulate(row) for row in wall)
)
if len(edges) == 1: # only one brick wide
return len(edgeswall)
_, max_edges = edges.most_common(2)[1] #skipping the right edge of the wall
return len(wall) - max_edges