Files
freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-321-swapping-counters.chinese.md
Kristofer Koishigawa b3213fc892 fix(i18n): chinese test suite (#38220)
* fix: Chinese test suite

Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working.

* fix: ran script, updated testStrings and solutions
2020-03-03 18:49:47 +05:30

72 lines
1.5 KiB
Markdown
Raw 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: 5900f4ae1000cf542c50ffc0
challengeType: 5
title: 'Problem 321: Swapping Counters'
videoUrl: ''
localeTitle: 问题321交换计数器
---
## Description
<section id="description">
由2n + 1个正方形组成的水平行在一端有n个红色计数器在另一端有n个蓝色计数器中间由一个空的正方形隔开。 例如当n = 3时。
计数器可以从一个正方形移动到下一个正方形(滑动),也可以跳过另一个计数器(跳),只要该计数器旁边的正方形未被占用即可。
令Mn表示完全反转彩色计数器位置的最小移动/动作数; 也就是说,将所有红色计数器向右移动,并将所有蓝色计数器向左移动。
可以验证M3= 15它也恰好是三角形数。
如果我们基于n的值创建一个序列其中Mn是一个三角形数字那么前五个项将是
1、3、10、22和63它们的总和为99。
找出该序列的前四十项之和。
</section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler321()</code>应该返回2470433131948040。
testString: assert.strictEqual(euler321(), 2470433131948040);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler321() {
// Good luck!
return true;
}
euler321();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>