Processing math: 100%

Problem #72

GitHub

You are given six characters G I T H U B to make a string of length N. However there are some limitations:

  • I can not come directly after G.
  • H can not come directly after G or B.
  • T can not come directly after T or U.
  • The string should be a palindrome.

How many ways are there to form a string of length N = 7162534?

Submit the answer modulo 1000000007.

dp

Contributed by Vikas Yadav

Solved by 61 users

Log in to submit answers.

Is something wrong?

Maintaining a collection of high quality questions is our top priority. If, however, you do find an error, report the problem and we'll make sure it is reviewed soon.