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:
Input: n = 2-int
Output: 2-int
Explanation: A 2 × 2 board can be tiled either with two vertical dominoes or with two horizontal dominoes.
Input: n = 4-int
Output: 11-int
Explanation: There are 11 distinct tilings of a 2 × 4 board using dominoes and L-shaped trominoes (counting different placements and orientations as different tilings).
Input: n = 7-int
Output: 117-int
Explanation: As n grows, tromino placements create many additional configurations beyond domino-only tilings, and for n = 7 the total number of complete tilings is 117.
Input: n = 1000-int
Output: 979232805-int
Explanation: The number of tilings becomes extremely large, so the result is returned modulo 10^9 + 7.
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: