Processing math: 100%

Problem #191

Save Jon Snow

Jon Snow hands Gendry a message, tells him to go to Eastwatch and send a raven to Daenerys to rescue them. Currently, Gendry is at (0,0) and the castle is situated at (N,N). In order to escape the battlefield, he can only move from (i,j) to (i,j+1) or (i+1,j) or (i+1,j+1).

Find the number of paths that can be taken by Gendry to reach the castle modulo 10^9+7 for N = 10^7.

Contributed by Adarsh Kumar

Solved by 41 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.