Tap here to switch tabs
Problem
Submissions

Problem: Number of Ways to Build Sturdy Brick Wall

Try to solve the Number of Ways to Build Sturdy Brick Wall problem.

Statement

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 11.

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 109+710^9 + 7.

Constraints:

  • 1≤1 \leq height ≤100\leq 100

  • 1≤1 \leq width ≤10\leq 10

  • 1≤1 \leq bricks.length ≤10\leq 10

  • 1≤1 \leq bricks[i] ≤10\leq 10

  • All the values of bricks are unique.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Ways to Build Sturdy Brick Wall

Try to solve the Number of Ways to Build Sturdy Brick Wall problem.

Statement

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 11.

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 109+710^9 + 7.

Constraints:

  • 1≤1 \leq height ≤100\leq 100

  • 1≤1 \leq width ≤10\leq 10

  • 1≤1 \leq bricks.length ≤10\leq 10

  • 1≤1 \leq bricks[i] ≤10\leq 10

  • All the values of bricks are unique.