Feat: add new Markdown parser (#39800)
and change all the challenges to new `md` format.
This commit is contained in:
committed by
GitHub
parent
a07f84c8ec
commit
0bd52f8bd1
@ -5,49 +5,57 @@ challengeType: 5
|
||||
forumTopicId: 302334
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
# --description--
|
||||
|
||||
Write a function to find the sum of squares of an array of integers.
|
||||
|
||||
</section>
|
||||
# --hints--
|
||||
|
||||
## Instructions
|
||||
`sumsq` should be a function.
|
||||
|
||||
<section id='instructions'>
|
||||
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>sumsq</code> should be a function.
|
||||
testString: assert(typeof sumsq == 'function');
|
||||
- text: <code>sumsq([1, 2, 3, 4, 5])</code> should return a number.
|
||||
testString: assert(typeof sumsq([1, 2, 3, 4, 5]) == 'number');
|
||||
- text: <code>sumsq([1, 2, 3, 4, 5])</code> should return <code>55</code>.
|
||||
testString: assert.equal(sumsq([1, 2, 3, 4, 5]), 55);
|
||||
- text: <code>sumsq([25, 32, 12, 7, 20])</code> should return <code>2242</code>.
|
||||
testString: assert.equal(sumsq([25, 32, 12, 7, 20]), 2242);
|
||||
- text: <code>sumsq([38, 45, 35, 8, 13])</code> should return <code>4927</code>.
|
||||
testString: assert.equal(sumsq([38, 45, 35, 8, 13]), 4927);
|
||||
- text: <code>sumsq([43, 36, 20, 34, 24])</code> should return <code>5277</code>.
|
||||
testString: assert.equal(sumsq([43, 36, 20, 34, 24]), 5277);
|
||||
- text: <code>sumsq([12, 33, 26, 18, 1, 16, 3])</code> should return <code>2499</code>.
|
||||
testString: assert.equal(sumsq([12, 33, 26, 18, 1, 16, 3]), 2499);
|
||||
```js
|
||||
assert(typeof sumsq == 'function');
|
||||
```
|
||||
|
||||
</section>
|
||||
`sumsq([1, 2, 3, 4, 5])` should return a number.
|
||||
|
||||
## Challenge Seed
|
||||
```js
|
||||
assert(typeof sumsq([1, 2, 3, 4, 5]) == 'number');
|
||||
```
|
||||
|
||||
<section id='challengeSeed'>
|
||||
`sumsq([1, 2, 3, 4, 5])` should return `55`.
|
||||
|
||||
<div id='js-seed'>
|
||||
```js
|
||||
assert.equal(sumsq([1, 2, 3, 4, 5]), 55);
|
||||
```
|
||||
|
||||
`sumsq([25, 32, 12, 7, 20])` should return `2242`.
|
||||
|
||||
```js
|
||||
assert.equal(sumsq([25, 32, 12, 7, 20]), 2242);
|
||||
```
|
||||
|
||||
`sumsq([38, 45, 35, 8, 13])` should return `4927`.
|
||||
|
||||
```js
|
||||
assert.equal(sumsq([38, 45, 35, 8, 13]), 4927);
|
||||
```
|
||||
|
||||
`sumsq([43, 36, 20, 34, 24])` should return `5277`.
|
||||
|
||||
```js
|
||||
assert.equal(sumsq([43, 36, 20, 34, 24]), 5277);
|
||||
```
|
||||
|
||||
`sumsq([12, 33, 26, 18, 1, 16, 3])` should return `2499`.
|
||||
|
||||
```js
|
||||
assert.equal(sumsq([12, 33, 26, 18, 1, 16, 3]), 2499);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function sumsq(array) {
|
||||
@ -55,12 +63,7 @@ function sumsq(array) {
|
||||
}
|
||||
```
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
|
||||
<section id='solution'>
|
||||
# --solutions--
|
||||
|
||||
```js
|
||||
function sumsq(array) {
|
||||
@ -73,5 +76,3 @@ function sumsq(array) {
|
||||
return sum;
|
||||
}
|
||||
```
|
||||
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user