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

1.5 KiB

id, title, isRequired, challengeType, videoUrl, localeTitle
id title isRequired challengeType videoUrl localeTitle
a3566b1109230028080c9345 Sum All Numbers in a Range true 5 求和范围中的所有数字

Description

我们将通过两个数字的数组。返回这两个数字的总和加上它们之间所有数字的总和。最低的数字并不总是第一位。如果卡住,请记得使用Read-Search-Ask 。尝试配对程序。编写自己的代码。

Instructions

Tests

tests:
  - text: '<code>sumAll([1, 4])</code>应该返回一个数字。'
    testString: assert(typeof sumAll([1, 4]) === 'number');
  - text: '<code>sumAll([1, 4])</code>应该返回10。'
    testString: assert.deepEqual(sumAll([1, 4]), 10);
  - text: '<code>sumAll([4, 1])</code>应该返回10。'
    testString: assert.deepEqual(sumAll([4, 1]), 10);
  - text: '<code>sumAll([5, 10])</code>应该返回45。'
    testString: assert.deepEqual(sumAll([5, 10]), 45);
  - text: '<code>sumAll([10, 5])</code>应该返回45。'
    testString: assert.deepEqual(sumAll([10, 5]), 45);

Challenge Seed

function sumAll(arr) {
  return 1;
}

sumAll([1, 4]);

Solution

// solution required