freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-106-special-subset-...

56 lines
1.5 KiB
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: 5900f3d71000cf542c50fee9
challengeType: 5
title: 'Problem 106: Special subset sums: meta-testing'
videoUrl: ''
localeTitle: 问题106特殊子集和元测试
---
## Description
<section id="description">设SA表示大小为n的集合A中的元素之和。如果对于任何两个非空的不相交子集B和C我们将其称为特殊和集合以下属性为真SB≠SC;也就是说子集的总和不能相等。如果B包含的元素多于C则SB&gt; SC。对于这个问题我们假设给定的集合包含n个严格增加的元素并且它已经满足第二个规则。令人惊讶的是在可以从n = 4的集合中获得的25个可能的子集对中仅需要对这些对中的1个进行相等性测试第一规则。类似地当n = 7时仅需要测试966个子集对中的70个。对于n = 12可以获得多少261625个子集对需要进行相等性测试注意此问题与问题103和问题105有关。 </section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler106()</code>应返回21384。
testString: 'assert.strictEqual(euler106(), 21384, "<code>euler106()</code> should return 21384.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler106() {
// Good luck!
return true;
}
euler106();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>