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?

  1. A. 16
  2. B. 12
  3. C. 14
  4. 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

Exams that ask this topic