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,43 +5,75 @@ challengeType: 5
|
||||
forumTopicId: 385275
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
# --description--
|
||||
|
||||
In this challenge, you have to find the strings that are the longest among the given strings.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
# --instructions--
|
||||
|
||||
Write a function that takes an array of strings and returns the strings that have a length equal to the longest length.
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
# --hints--
|
||||
|
||||
``` yml
|
||||
tests:
|
||||
- text: <code>longestString</code> should be a function.
|
||||
testString: assert(typeof longestString == 'function');
|
||||
- text: <code>longestString(["a", "bb", "ccc", "ee", "f", "ggg"])</code> should return a array.
|
||||
testString: assert(Array.isArray(longestString(["a", "bb", "ccc", "ee", "f", "ggg"])));
|
||||
- text: <code>longestString(["a", "bb", "ccc", "ee", "f", "ggg"])</code> should return <code>["ccc", "ggg"]'</code>.
|
||||
testString: assert.deepEqual(longestString(["a", "bb", "ccc", "ee", "f", "ggg"]), ["ccc", "ggg"]);
|
||||
- text: <code>longestString(["afedg", "bb", "sdccc", "efdee", "f", "geegg"])</code> should return <code>["afedg", "sdccc", "efdee", "geegg"]</code>.
|
||||
testString: assert.deepEqual(longestString(["afedg", "bb", "sdccc", "efdee", "f", "geegg"]), ["afedg", "sdccc", "efdee", "geegg"]);
|
||||
- text: <code>longestString(["a", "bhghgb", "ccc", "efde", "fssdrr", "ggg"])</code> should return <code>["bhghgb", "fssdrr"]</code>.
|
||||
testString: assert.deepEqual(longestString(["a", "bhghgb", "ccc", "efde", "fssdrr", "ggg"]), ["bhghgb", "fssdrr"]);
|
||||
- text: <code>longestString(["ahgfhg", "bdsfsb", "ccc", "ee", "f", "ggdsfg"])</code> should return <code>["ahgfhg", "bdsfsb", "ggdsfg"]</code>.
|
||||
testString: assert.deepEqual(longestString(["ahgfhg", "bdsfsb", "ccc", "ee", "f", "ggdsfg"]), ["ahgfhg", "bdsfsb", "ggdsfg"]);
|
||||
- text: <code>longestString(["a", "bbdsf", "ccc", "edfe", "gzzzgg"])</code> should return <code>["gzzzgg"]</code>.
|
||||
testString: assert.deepEqual(longestString(["a", "bbdsf", "ccc", "edfe", "gzzzgg"]), ["gzzzgg"]);
|
||||
`longestString` should be a function.
|
||||
|
||||
```js
|
||||
assert(typeof longestString == 'function');
|
||||
```
|
||||
|
||||
</section>
|
||||
`longestString(["a", "bb", "ccc", "ee", "f", "ggg"])` should return a array.
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
```js
|
||||
assert(Array.isArray(longestString(['a', 'bb', 'ccc', 'ee', 'f', 'ggg'])));
|
||||
```
|
||||
|
||||
<div id='js-seed'>
|
||||
`longestString(["a", "bb", "ccc", "ee", "f", "ggg"])` should return `["ccc", "ggg"]'`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(longestString(['a', 'bb', 'ccc', 'ee', 'f', 'ggg']), [
|
||||
'ccc',
|
||||
'ggg'
|
||||
]);
|
||||
```
|
||||
|
||||
`longestString(["afedg", "bb", "sdccc", "efdee", "f", "geegg"])` should return `["afedg", "sdccc", "efdee", "geegg"]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(
|
||||
longestString(['afedg', 'bb', 'sdccc', 'efdee', 'f', 'geegg']),
|
||||
['afedg', 'sdccc', 'efdee', 'geegg']
|
||||
);
|
||||
```
|
||||
|
||||
`longestString(["a", "bhghgb", "ccc", "efde", "fssdrr", "ggg"])` should return `["bhghgb", "fssdrr"]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(
|
||||
longestString(['a', 'bhghgb', 'ccc', 'efde', 'fssdrr', 'ggg']),
|
||||
['bhghgb', 'fssdrr']
|
||||
);
|
||||
```
|
||||
|
||||
`longestString(["ahgfhg", "bdsfsb", "ccc", "ee", "f", "ggdsfg"])` should return `["ahgfhg", "bdsfsb", "ggdsfg"]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(
|
||||
longestString(['ahgfhg', 'bdsfsb', 'ccc', 'ee', 'f', 'ggdsfg']),
|
||||
['ahgfhg', 'bdsfsb', 'ggdsfg']
|
||||
);
|
||||
```
|
||||
|
||||
`longestString(["a", "bbdsf", "ccc", "edfe", "gzzzgg"])` should return `["gzzzgg"]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(longestString(['a', 'bbdsf', 'ccc', 'edfe', 'gzzzgg']), [
|
||||
'gzzzgg'
|
||||
]);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function longestString(strings) {
|
||||
@ -49,12 +81,7 @@ function longestString(strings) {
|
||||
}
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
# --solutions--
|
||||
|
||||
```js
|
||||
function longestString(strings) {
|
||||
@ -71,5 +98,3 @@ function longestString(strings) {
|
||||
return result
|
||||
}
|
||||
```
|
||||
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user