Domino and Tromino Tiling asks you to count the distinct ways to fully cover a two-by-n board with two-by-one dominoes and L-shaped trominoes, returning the result modulo a large prime.
Statement
Given an integer n, return the number of distinct ways to completely tile a 2imesn board using 2imes1 dominoes and L shaped trominoes. Since the answer can be very large, return it modulo 109+7.
Constraints:
1≤n≤1000
Examples
Fetching Slides...
Understand the problem
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Domino and Tromino Tiling
1.
If the input is n = 1, what output should be returned?
A.
(0)
B.
(1)
C.
(2)
D.
(3)
1 / 3
Figure it out!
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Sequence - Vertical
Drag and drop the cards to rearrange them in the correct sequence
1
2
3
4
5
Try it yourself
Implement your solution in the following coding playground.
Domino and Tromino Tiling asks you to count the distinct ways to fully cover a two-by-n board with two-by-one dominoes and L-shaped trominoes, returning the result modulo a large prime.
Statement
Given an integer n, return the number of distinct ways to completely tile a 2imesn board using 2imes1 dominoes and L shaped trominoes. Since the answer can be very large, return it modulo 109+7.
Constraints:
1≤n≤1000
Examples
Fetching Slides...
Understand the problem
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Domino and Tromino Tiling
1.
If the input is n = 1, what output should be returned?
A.
(0)
B.
(1)
C.
(2)
D.
(3)
1 / 3
Figure it out!
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Sequence - Vertical
Drag and drop the cards to rearrange them in the correct sequence
1
2
3
4
5
Try it yourself
Implement your solution in the following coding playground.