aab
should return 2 because it has 6 total permutations (aab
, aab
, aba
, aba
, baa
, baa
), but only 2 of them (aba
and aba
) don't have the same letter (in this case a
) repeating.
Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code.
permAlone("aab")
should return a number.
testString: assert.isNumber(permAlone('aab'), 'permAlone("aab")
should return a number.');
- text: permAlone("aab")
should return 2.
testString: assert.strictEqual(permAlone('aab'), 2, 'permAlone("aab")
should return 2.');
- text: permAlone("aaa")
should return 0.
testString: assert.strictEqual(permAlone('aaa'), 0, 'permAlone("aaa")
should return 0.');
- text: permAlone("aabb")
should return 8.
testString: assert.strictEqual(permAlone('aabb'), 8, 'permAlone("aabb")
should return 8.');
- text: permAlone("abcdefa")
should return 3600.
testString: assert.strictEqual(permAlone('abcdefa'), 3600, 'permAlone("abcdefa")
should return 3600.');
- text: permAlone("abfdefa")
should return 2640.
testString: assert.strictEqual(permAlone('abfdefa'), 2640, 'permAlone("abfdefa")
should return 2640.');
- text: permAlone("zzzzzzzz")
should return 0.
testString: assert.strictEqual(permAlone('zzzzzzzz'), 0, 'permAlone("zzzzzzzz")
should return 0.');
- text: permAlone("a")
should return 1.
testString: assert.strictEqual(permAlone('a'), 1, 'permAlone("a")
should return 1.');
- text: permAlone("aaab")
should return 0.
testString: assert.strictEqual(permAlone('aaab'), 0, 'permAlone("aaab")
should return 0.');
- text: permAlone("aaabb")
should return 12.
testString: assert.strictEqual(permAlone('aaabb'), 12, 'permAlone("aaabb")
should return 12.');
```