790. Domino and Tromino Tiling Medium
1/**
2 * [790] Domino and Tromino Tiling
3 *
4 * You have two types of tiles: a 2 x 1 domino shape and a tromino shape. You may rotate these shapes.
5 * <img alt="" src="https://assets.leetcode.com/uploads/2021/07/15/lc-domino.jpg" style="width: 362px; height: 195px;" />
6 * Given an integer n, return the number of ways to tile an 2 x n board. Since the answer may be very large, return it modulo 10^9 + 7.
7 * In a tiling, every square must be covered by a tile. Two tilings are different if and only if there are two 4-directionally adjacent cells on the board such that exactly one of the tilings has both squares occupied by a tile.
8 *
9 * Example 1:
10 * <img alt="" src="https://assets.leetcode.com/uploads/2021/07/15/lc-domino1.jpg" style="width: 500px; height: 226px;" />
11 * Input: n = 3
12 * Output: 5
13 * Explanation: The five different ways are show above.
14 *
15 * Example 2:
16 *
17 * Input: n = 1
18 * Output: 1
19 *
20 *
21 * Constraints:
22 *
23 * 1 <= n <= 1000
24 *
25 */
26pub struct Solution {}
27
28// problem: https://leetcode.com/problems/domino-and-tromino-tiling/
29// discuss: https://leetcode.com/problems/domino-and-tromino-tiling/discuss/?currentPage=1&orderBy=most_votes&query=
30
31// submission codes start here
32
33impl Solution {
34 pub fn num_tilings(n: i32) -> i32 {
35 0
36 }
37}
38
39// submission codes end
40
41#[cfg(test)]
42mod tests {
43 use super::*;
44
45 #[test]
46 fn test_790() {
47 }
48}
49
Back
© 2025 bowen.ge All Rights Reserved.