2.3 KiB
2.3 KiB
id, challengeType, videoUrl, localeTitle
id | challengeType | videoUrl | localeTitle |
---|---|---|---|
5a23c84252665b21eecc7ec5 | 5 | 约瑟夫斯问题 |
Description
Instructions
Tests
tests:
- text: <code>josephus</code>应该是一个功能。
testString: assert(typeof josephus=='function');
- text: '<code>josephus(30,3)</code>应该返回一个数字。'
testString: assert(typeof josephus(30,3)=='number');
- text: '<code>josephus(30,3)</code>应该回<code>29</code> 。'
testString: assert.equal(josephus(30,3),29);
- text: '<code>josephus(30,5)</code>应该返回<code>3</code> 。'
testString: assert.equal(josephus(30,5),3);
- text: '<code>josephus(20,2)</code>应该返回<code>9</code> 。'
testString: assert.equal(josephus(20,2),9);
- text: '<code>josephus(17,6)</code>应该回归<code>2</code> 。'
testString: assert.equal(josephus(17,6),2);
- text: '<code>josephus(29,4)</code>应该返回<code>2</code> 。'
testString: assert.equal(josephus(29,4),2);
Challenge Seed
function josephus (init, kill) {
// Good luck!
}
Solution
// solution required
/section>