--- id: 5900f37d1000cf542c50fe90 challengeType: 5 title: 'Problem 17: Number letter counts' videoUrl: '' localeTitle: 问题17:数字字母计数 --- ## Description
如果数字1到5用文字写出:一,二,三,四,五,则总共使用3 + 3 + 5 + 4 + 4 = 19个字母。如果从1到包含limit所有数字都用文字写出,那么会使用多少个字母? 注意:不要计算空格或连字符。例如,342(三百四十二)包含23个字母,115(一百一十五)包含20个字母。在写出数字时使用“和”符合英国的用法。
## Instructions
## Tests
```yml tests: - text: numberLetterCounts(5)应返回19。 testString: 'assert.strictEqual(numberLetterCounts(5), 19, "numberLetterCounts(5) should return 19.");' - text: numberLetterCounts(150)应该返回1903。 testString: 'assert.strictEqual(numberLetterCounts(150), 1903, "numberLetterCounts(150) should return 1903.");' - text: numberLetterCounts(1000)应该返回21124。 testString: 'assert.strictEqual(numberLetterCounts(1000), 21124, "numberLetterCounts(1000) should return 21124.");' ```
## Challenge Seed
```js function numberLetterCounts(limit) { // Good luck! return true; } numberLetterCounts(5); ```
## Solution
```js // solution required ```