freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-408-admissible-path...

831 B
Raw Blame History

id title challengeType videoUrl
5900f5091000cf542c51001b 问题408通过网格的可允许路径 5

--description--

如果xy和x + y都是正的正方形那么我们称格子点xy是不允许的。例如9,16是不允许的0,43,19,4则不允许。

考虑从点x1y1到点x2y2的路径仅使用北或东的单位步长。如果其中间点都不允许我们可以称这样的路径是可以接受的。

令Pn是从0,0nn的可允许路径的数量。可以证实P5= 252P16= 596994440和P1000mod 1 000 000 007 = 341920854。

求P10 000 000mod 1 000 000 007。

--hints--

euler408()应该返回299742733。

assert.strictEqual(euler408(), 299742733);

--solutions--