You are given two integers, height and width, representing the dimensions of a brick wall you want to construct. You are also given an array of unique integers bricks, representing the distinct lengths of bricks at your disposal. You possess an unlimited quantity of each brick type, and every brick has a height of
A wall is considered sturdy if:
Every row has a total width equal to width.
No vertical joint between bricks aligns directly across any two adjacent rows, excluding the left and right outer boundaries of the wall.
Return the total number of distinct ways to construct a sturdy brick wall of the given height and width. Since the result can be large, return it modulo
Constraints:
height
width
bricks.length
bricks[i]
All the values of bricks are unique.
You are given two integers, height and width, representing the dimensions of a brick wall you want to construct. You are also given an array of unique integers bricks, representing the distinct lengths of bricks at your disposal. You possess an unlimited quantity of each brick type, and every brick has a height of
A wall is considered sturdy if:
Every row has a total width equal to width.
No vertical joint between bricks aligns directly across any two adjacent rows, excluding the left and right outer boundaries of the wall.
Return the total number of distinct ways to construct a sturdy brick wall of the given height and width. Since the result can be large, return it modulo
Constraints:
height
width
bricks.length
bricks[i]
All the values of bricks are unique.