Search
⌘K

Leetcode 2184. Number of Ways to Build Sturdy Brick Wall

Count how many ways to build an h-row wall of given width by arranging bricks in each row (bricks of integer lengths summing to the width) so that there is no vertical seam running uninterrupted from top to bottom. Key idea: enumerate valid row seam patterns, treat two rows as compatible if they have no common seam positions, and count height-h sequences of compatible rows via DP or matrix exponentiation (modulo a large prime).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.