Brick Wall
Medium · Hashing · about 15 minutes
Asked at Meta, Google, Amazon, Bloomberg.
A wall has rows of bricks of equal total width; wall[i] lists the widths of the bricks in row i from left to right. Draw a vertical line from top to bottom that crosses the fewest bricks (a line along an edge between two bricks doesn't cross them; the two outer edges aren't allowed). Return the number of bricks crossed.