Ezvor

2184. Number of Ways to Build Sturdy Brick Wall

MediumArray Preparing judge… LeetCode
ArrayDynamic ProgrammingBit ManipulationBitmask

Hints

Hint 1
A row of bricks can be represented uniquely by the points where two bricks are joined together.
Hint 2
For a given row of bricks, how many configurations of bricks could you have put below this row such that the wall is sturdy?
Hint 3
Use dynamic programming to store the number of possible sturdy walls with a given height and configuration of bricks on the top row.