Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
A row of bricks can be represented uniquely by the points where two bricks are joined together.
For a given row of bricks, how many configurations of bricks could you have put below this row such that the wall is sturdy?
Use dynamic programming to store the number of possible sturdy walls with a given height and configuration of bricks on the top row.