Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-115-counting-block-combinations-ii.md

51 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f3df1000cf542c50fef1
title: '问题 115计数块组合 II'
challengeType: 5
forumTopicId: 301741
dashedName: problem-115-counting-block-combinations-ii
---
# --description--
一排长度为 `n` 个单位的行上放置了最小长度为 `m` 个单位的红色块,这样任何两个红色块(允许长度不同)至少被一个黑色方块隔开。
让填充计数函数,$F(m, n)$,表示可以填充的行数。
例如, $F(3, 29) = 673135$$F(3, 30) = 1089155$。
就是说,对于 m = 3可以看出 n = 30 是函数结果超过 100 万的最小 n 值。
同样,对于 m = 10可以验证 $F(10, 56) = 880711$ 和 $F(10, 57) = 1148904$。即函数第一次超过 100 万的 n 最小值为 57。
对于 m = 50找到最小值 `n` 的值,让函数第一次超过 100 万。
**注意:** 这是问题 114 的一个困难版本。
# --hints--
`countingBlockTwo()` 应该返回 `168`
```js
assert.strictEqual(countingBlockTwo(), 168);
```
# --seed--
## --seed-contents--
```js
function countingBlockTwo() {
return true;
}
countingBlockTwo();
```
# --solutions--
```js
// solution required
```