60 lines
1.8 KiB
Markdown
60 lines
1.8 KiB
Markdown
|
---
|
||
|
id: 5900f37f1000cf542c50fe92
|
||
|
challengeType: 5
|
||
|
title: 'Problem 19: Counting Sundays'
|
||
|
videoUrl: ''
|
||
|
localeTitle: 'Problema 19: contando os domingos'
|
||
|
---
|
||
|
|
||
|
## Description
|
||
|
<section id="description"> Você recebe as seguintes informações, mas talvez prefira pesquisar por si mesmo. <ul><li> 1 de janeiro de 1900 foi uma segunda-feira. </li><li> Trinta dias tem setembro <br> Abril, junho e novembro. <br> Todo o resto tem trinta e um, <br> Salvando fevereiro sozinho, <br> Que tem vinte e oito, chova ou faça sol. <br> E nos anos bissextos, vinte e nove. </li><li> Um ano bissexto ocorre em qualquer ano divisível por 4, mas não em um século, a menos que seja divisível por 400. </li> Quantos domingos caíram no primeiro dia do mês durante o século XX (1º de janeiro de 1901 a 31 de dezembro de 2000)? </ul></section>
|
||
|
|
||
|
## Instructions
|
||
|
<section id="instructions">
|
||
|
</section>
|
||
|
|
||
|
## Tests
|
||
|
<section id='tests'>
|
||
|
|
||
|
```yml
|
||
|
tests:
|
||
|
- text: '<code>countingSundays(1943, 1946)</code> deve retornar 6.'
|
||
|
testString: 'assert.strictEqual(countingSundays(1943, 1946), 6, "<code>countingSundays(1943, 1946)</code> should return 6.");'
|
||
|
- text: '<code>countingSundays(1995, 2000)</code> deve retornar 9.'
|
||
|
testString: 'assert.strictEqual(countingSundays(1995, 2000), 9, "<code>countingSundays(1995, 2000)</code> should return 9.");'
|
||
|
- text: '<code>countingSundays(1901, 2000)</code> deve retornar 171.'
|
||
|
testString: 'assert.strictEqual(countingSundays(1901, 2000), 171, "<code>countingSundays(1901, 2000)</code> should return 171.");'
|
||
|
|
||
|
```
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Challenge Seed
|
||
|
<section id='challengeSeed'>
|
||
|
|
||
|
<div id='js-seed'>
|
||
|
|
||
|
```js
|
||
|
function countingSundays(firstYear, lastYear) {
|
||
|
// Good luck!
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
countingSundays(1943, 1946);
|
||
|
|
||
|
```
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Solution
|
||
|
<section id='solution'>
|
||
|
|
||
|
```js
|
||
|
// solution required
|
||
|
```
|
||
|
</section>
|