ProgrammingHard
The number of ways to tile a 2 x 5 board exactly with 2 x 1 dominoes, counting orientations, is what?
- A. 5
- B. 6
- C. 13
- D. 8
Correct answer: D. 8
f(n) = f(n-1) + f(n-2) with f(0) = f(1) = 1, so the values run 1, 1, 2, 3, 5, 8 and f(5) = 8.
More C Programming questions
- The length of the longest common subsequence of "ABCBDAB" and "BDCAB" is what?
- What is the Levenshtein edit distance between "kitten" and "sitting" (insert, delete, replace, each cost 1)?
- A 5 x 7 int matrix is stored in row-major order. What is the flat offset of the cell at 1-based row 3, column 4?
- On a 4 x 4 grid, a robot moves only right or down from (0,0) to (3,3) and may not enter cell (1,1). How many routes are there?
- Which parameter declaration accepts an int a[3][4] argument from main without a warning?
- On an n x n grid with n = 4, how many cells lie on at least one of the two main diagonals?