62 lines
1.5 KiB
Markdown
62 lines
1.5 KiB
Markdown
---
|
||
id: 5900f38b1000cf542c50fe9e
|
||
challengeType: 5
|
||
title: 'Problem 31: Coin sums'
|
||
videoUrl: ''
|
||
localeTitle: 'Problema 31: Sumas de monedas'
|
||
---
|
||
|
||
## Description
|
||
<section id="description"> En Inglaterra, la moneda se compone de libras, £ y peniques, p, y hay ocho monedas en circulación general: 1p, 2p, 5p, 10p, 20p, 50p, £ 1 (100p) y £ 2 (200p). Es posible hacer £ 2 de la siguiente manera: 1 × £ 1 + 1 × 50p + 2 × 20p + 1 × 5p + 1 × 2p + 3 × 1p ¿Cuántas formas diferentes se pueden hacer con cualquier número? de monedas? </section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>coinSums(50)</code> debe devolver 451.
|
||
testString: 'assert(coinSums(50) == 451, "<code>coinSums(50)</code> should return 451.");'
|
||
- text: <code>coinSums(100)</code> debe devolver 4563.
|
||
testString: 'assert(coinSums(100) == 4563, "<code>coinSums(100)</code> should return 4563.");'
|
||
- text: <code>coinSums(150)</code> debe devolver 21873.
|
||
testString: 'assert(coinSums(150) == 21873, "<code>coinSums(150)</code> should return 21873.");'
|
||
- text: <code>coinSums(200)</code> debe devolver 73682.
|
||
testString: 'assert(coinSums(200) == 73682, "<code>coinSums(200)</code> should return 73682.");'
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function coinSums(n) {
|
||
// Good luck!
|
||
return n;
|
||
}
|
||
|
||
coinSums(200);
|
||
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|