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

28 lines
831 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f5091000cf542c51001b
title: 问题408通过网格的可允许路径
challengeType: 5
videoUrl: ''
---
# --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。
```js
assert.strictEqual(euler408(), 299742733);
```
# --solutions--