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
@ -1,12 +1,11 @@
|
||||
---
|
||||
id: 5900f3891000cf542c50fe9c
|
||||
challengeType: 5
|
||||
title: 'Problem 29: Distinct powers'
|
||||
challengeType: 5
|
||||
forumTopicId: 301941
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
# --description--
|
||||
|
||||
Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
|
||||
|
||||
@ -23,39 +22,43 @@ If they are then placed in numerical order, with any repeats removed, we get the
|
||||
4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125
|
||||
</div>
|
||||
|
||||
How many distinct terms are in the sequence generated by <var>a<sup>b</sup></var> for 2 ≤ <var>a</var> ≤ <var>`n`</var> and 2 ≤ <var>b</var> ≤ <var>`n`</var>?
|
||||
How many distinct terms are in the sequence generated by `ab` for 2 ≤ `a` ≤ `n` and 2 ≤ `b` ≤ `n`?
|
||||
|
||||
</section>
|
||||
# --hints--
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>distinctPowers(15)</code> should return a number.
|
||||
testString: assert(typeof distinctPowers(15) === 'number');
|
||||
- text: <code>distinctPowers(15)</code> should return 177.
|
||||
testString: assert.strictEqual(distinctPowers(15), 177);
|
||||
- text: <code>distinctPowers(20)</code> should return 324.
|
||||
testString: assert.strictEqual(distinctPowers(20), 324);
|
||||
- text: <code>distinctPowers(25)</code> should return 519.
|
||||
testString: assert.strictEqual(distinctPowers(25), 519);
|
||||
- text: <code>distinctPowers(30)</code> should return 755.
|
||||
testString: assert.strictEqual(distinctPowers(30), 755);
|
||||
`distinctPowers(15)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof distinctPowers(15) === 'number');
|
||||
```
|
||||
|
||||
</section>
|
||||
`distinctPowers(15)` should return 177.
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
```js
|
||||
assert.strictEqual(distinctPowers(15), 177);
|
||||
```
|
||||
|
||||
<div id='js-seed'>
|
||||
`distinctPowers(20)` should return 324.
|
||||
|
||||
```js
|
||||
assert.strictEqual(distinctPowers(20), 324);
|
||||
```
|
||||
|
||||
`distinctPowers(25)` should return 519.
|
||||
|
||||
```js
|
||||
assert.strictEqual(distinctPowers(25), 519);
|
||||
```
|
||||
|
||||
`distinctPowers(30)` should return 755.
|
||||
|
||||
```js
|
||||
assert.strictEqual(distinctPowers(30), 755);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function distinctPowers(n) {
|
||||
@ -66,15 +69,7 @@ function distinctPowers(n) {
|
||||
distinctPowers(30);
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
|
||||
# --solutions--
|
||||
|
||||
```js
|
||||
const distinctPowers = (n) => {
|
||||
@ -88,5 +83,3 @@ const distinctPowers = (n) => {
|
||||
return list.length;
|
||||
};
|
||||
```
|
||||
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user