Data Structures & AlgorithmsVery hardGATE CS · TCS NQT

A frog at 0 wants to reach exactly 12 by jumps of length 2 or 3 to the right. How many different jump sequences take it there?

  1. A. 13
  2. B. 14
  3. C. 12
  4. D. 16

Correct answer: C. 12

Let f(x) be the number of sequences reaching x; f(x) = f(x-2) + f(x-3), with ordering mattering since each sequence differs in its steps.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic