ProgrammingVery hard
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?
- A. 16
- B. 12
- C. 14
- D. 8
Correct answer: D. 8
Without the obstacle there are C(6,3) = 20 routes. Routes through (1,1) number C(2,1) x C(4,2) = 2 x 6 = 12, so 20 - 12 = 8 avoid it.
More C Programming questions
- 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?
- int a[2][2] = {1, 2, 3, 4}; What is a[1][0]?
- int a[2][3]; What is sizeof(a[1]) on a platform with 4-byte int?
- How many trailing zero bits does 96 have? (96 is 1100000 in binary.)
- What is the index of the highest set bit of 1000 (so 2^index is the largest power of two that is at most 1000)?