--- id: a7bf700cd123b9a54eef01d5 challengeType: 5 videoUrl: '' title: 请不要重复 --- ## Description
返回没有重复连续字母的提供字符串的总排列数。假设提供的字符串中的所有字符都是唯一的。例如, aab应该返回2,因为它总共有6个排列( aabaababaababaabaa ),但只有2个( abaaba )没有相同的字母(在这种情况下为a )重复。如果卡住,请记得使用Read-Search-Ask 。尝试配对程序。编写自己的代码。
## Instructions
## Tests
```yml tests: - text: permAlone("aab")应返回一个数字。 testString: assert.isNumber(permAlone('aab')); - text: permAlone("aab")应返回2。 testString: assert.strictEqual(permAlone('aab'), 2); - text: permAlone("aaa")应该返回0。 testString: assert.strictEqual(permAlone('aaa'), 0); - text: permAlone("aabb")应该返回8。 testString: assert.strictEqual(permAlone('aabb'), 8); - text: permAlone("abcdefa")应返回3600。 testString: assert.strictEqual(permAlone('abcdefa'), 3600); - text: permAlone("abfdefa")应返回2640。 testString: assert.strictEqual(permAlone('abfdefa'), 2640); - text: permAlone("zzzzzzzz")应该返回0。 testString: assert.strictEqual(permAlone('zzzzzzzz'), 0); - text: permAlone("a")应返回1。 testString: assert.strictEqual(permAlone('a'), 1); - text: permAlone("aaab")应该返回0。 testString: assert.strictEqual(permAlone('aaab'), 0); - text: permAlone("aaabb")应该返回12。 testString: assert.strictEqual(permAlone('aaabb'), 12); ```
## Challenge Seed
```js function permAlone(str) { return str; } permAlone('aab'); ```
## Solution
```js // solution required ``` /section>