chore(i18n,curriculum): update translations (#43104)

This commit is contained in:
camperbot
2021-08-05 23:31:15 +09:00
committed by GitHub
parent e389517800
commit ea9c39434b
52 changed files with 241 additions and 223 deletions

View File

@ -1,6 +1,6 @@
---
id: 596fd036dc1ab896c5db98b1
title: Convert seconds to compound duration
title: Converter segundos para duração composta
challengeType: 5
forumTopicId: 302236
dashedName: convert-seconds-to-compound-duration
@ -8,69 +8,69 @@ dashedName: convert-seconds-to-compound-duration
# --description--
Implement a function which:
Implementar uma função que:
<ul>
<li>takes a positive integer representing a duration in seconds as input (e.g., <code>100</code>), and</li>
<li>returns a string which shows the same duration decomposed into weeks, days, hours, minutes, and seconds as detailed below (e.g., <code>1 min, 40 sec</code>).</li>
<li>receba um inteiro positivo que represente uma duração em segundos como entrada (por exemplo, <code>100</code>) e</li>
<li>retorna uma string que mostra a mesma duração decomposta em semanas, dias, horas, minutos e segundos detalhados abaixo (por exemplo, <code>1 min, 40 sec</code>).</li>
</ul>
Demonstrate that it passes the following three test-cases:
Demonstre que a função passa pelos três casos de teste:
<div style='font-size:115%; font-weight: bold;'>Test Cases</div>
<div style='font-size:115%; font-weight: bold;'>Casos de teste</div>
| Input number | Output number |
| ------------ | ------------------------- |
| 7259 | <code>2 hr, 59 sec</code> |
| 86400 | <code>1 d</code> |
| 6000000 | <code>9 wk, 6 d, 10 hr, 40 min</code> |
| Número de entrada | Número de saída |
| ----------------- | ------------------------- |
| 7259 | <code>2 hr, 59 sec</code> |
| 86400 | <code>1 d</code> |
| 6000000 | <code>9 wk, 6 d, 10 hr, 40 min</code> |
<div style="font-size:115%; font-weight: bold;">Details</div>
<div style="font-size:115%; font-weight: bold;">Detalhes</div>
<ul>
<li>
The following five units should be used:
As cinco unidades a seguir devem ser usadas:
| Unit | Suffix used in Output | Conversion |
| Unidade | Sufixo usado na saída | Conversão |
| ------ | --------------------- | --------------------- |
| week |!!crwdBlockTags_18_sgaTkcolBdwrc!! | 1 week = 7 days |
| day |!!crwdBlockTags_19_sgaTkcolBdwrc!! | 1 day = 24 hours |
| hour |!!crwdBlockTags_20_sgaTkcolBdwrc!! | 1 hour = 60 minutes |
| minute |!!crwdBlockTags_21_sgaTkcolBdwrc!! | 1 minute = 60 seconds |
| week |!!crwdBlockTags_18_sgaTkcolBdwrc!! | 1 semana = 7 dias |
| day |!!crwdBlockTags_19_sgaTkcolBdwrc!! | 1 dia = 24 horas |
| hour |!!crwdBlockTags_20_sgaTkcolBdwrc!! | 1 hora = 60 minutos |
| minute |!!crwdBlockTags_21_sgaTkcolBdwrc!! | 1 minuto = 60 segundos |
| second |!!crwdBlockTags_22_sgaTkcolBdwrc!! | --- |
</li>
<li>
However, <strong>only</strong> include quantities with non-zero values in the output (e.g., return <code>1 d</code> and not <code>0 wk, 1 d, 0 hr, 0 min, 0 sec</code>).
No entanto, <strong>somente</strong> inclua quantidades com valores diferentes de zero na saída (por exemplo, retorne <code>1 d</code> em vez de <code>0 wk, 1 d, 0 hr, 0 min, 0 sec</code>).
</li>
<li>
Give larger units precedence over smaller ones as much as possible (e.g., return <code>2 min, 10 sec</code> and not <code>1 min, 70 sec</code> or <code>130 sec</code>).
precedência a unidades maiores sobre unidades menores tanto quanto possível (por exemplo, retorne <code>2 min, 10 sec</code> e não <code>1 min, 70 sec</code> ou <code>130 sec</code>).
</li>
<li>
Mimic the formatting shown in the test-cases (quantities sorted from largest unit to smallest and separated by comma+space; value and unit of each quantity separated by space).
Imite a formatação mostrada nos casos de teste (quantidades ordenadas da maior unidade para a menor e separadas por vírgula + espaço, alem de valor e unidade de cada quantidade separada por espaço).
</li>
</ul>
# --hints--
`convertSeconds` should be a function.
`convertSeconds` deve ser uma função.
```js
assert(typeof convertSeconds === 'function');
```
`convertSeconds(7259)` should return `2 hr, 59 sec`.
`convertSeconds(7259)` deve retornar `2 hr, 59 sec`.
```js
assert.equal(convertSeconds(testCases[0]), results[0]);
```
`convertSeconds(86400)` should return `1 d`.
`convertSeconds(86400)` deve retornar `1 d`.
```js
assert.equal(convertSeconds(testCases[1]), results[1]);
```
`convertSeconds(6000000)` should return `9 wk, 6 d, 10 hr, 40 min`.
`convertSeconds(6000000)` deve retornar `9 wk, 6 d, 10 hr, 40 min`.
```js
assert.equal(convertSeconds(testCases[2]), results[2]);

View File

@ -1,6 +1,6 @@
---
id: 596fda99c69f779975a1b67d
title: Count occurrences of a substring
title: Contar as ocorrências de uma substring
challengeType: 5
forumTopicId: 302237
dashedName: count-occurrences-of-a-substring
@ -8,42 +8,42 @@ dashedName: count-occurrences-of-a-substring
# --description--
Create a function, or show a built-in function, to count the number of non-overlapping occurrences of a substring inside a string.
Crie uma função, ou mostre uma função integrada para contar o número de ocorrências não sobrepostas de uma substring dentro de uma string.
The function should take two arguments:
A função deve receber dois argumentos:
<ul>
<li>the first argument being the string to search, and</li>
<li>the second a substring to be searched for.</li>
<li>o primeiro argumento deve ser a string onde ocorrerá a busca, e</li>
<li>o segundo deve ser uma substring a ser buscada.</li>
</ul>
It should return an integer count.
A função deve retornar uma contagem inteira.
The matching should yield the highest number of non-overlapping matches.
A pesquisa deve produzir o maior número de correspondências não sobrepostas.
In general, this essentially means matching from left-to-right or right-to-left.
Em geral, isto significa, essencialmente, uma correspondência da esquerda para a direita e da direita para a esquerda.
# --hints--
`countSubstring` should be a function.
`countSubstring` deve ser uma função.
```js
assert(typeof countSubstring === 'function');
```
`countSubstring("the three truths", "th")` should return `3`.
`countSubstring("the three truths", "th")` deve retornar `3`.
```js
assert.equal(countSubstring(testCases[0], searchString[0]), results[0]);
```
`countSubstring("ababababab", "abab")` should return `2`.
`countSubstring("ababababab", "abab")` deve retornar `2`.
```js
assert.equal(countSubstring(testCases[1], searchString[1]), results[1]);
```
`countSubstring("abaabba*bbaba*bbab", "a*b")` should return `2`.
`countSubstring("abaabba*bbaba*bbab", "a*b")` deve retornar `2`.
```js
assert.equal(countSubstring(testCases[2], searchString[2]), results[2]);

View File

@ -1,6 +1,6 @@
---
id: 59713bd26bdeb8a594fb9413
title: Count the coins
title: Contar moedas
challengeType: 5
forumTopicId: 302238
dashedName: count-the-coins
@ -8,51 +8,51 @@ dashedName: count-the-coins
# --description--
There are four types of common coins in [US](https://en.wikipedia.org/wiki/United_States) currency:
Existem quatro tipos de moedas comuns no dinheiro dos [EUA](https://en.wikipedia.org/wiki/United_States):
<ul>
<li>quarters (25 cents)</li>
<li>dimes (10 cents)</li>
<li>nickels (5 cents), and</li>
<li>pennies (1 cent)</li>
<li>quarters (25 centavos)</li>
<li>dimes (10 centavos)</li>
<li>nickels (5 centavos) e</li>
<li>pennies (1 centavo)</li>
</ul>
<p>There are six ways to make change for 15 cents:</p>
<p>Há seis maneiras de fazer troco com 15 centavos:</p>
<ul>
<li>A dime and a nickel</li>
<li>A dime and 5 pennies</li>
<li>Um dime e um nickel</li>
<li>Um dime e 5 pennies</li>
<li>3 nickels</li>
<li>2 nickels and 5 pennies</li>
<li>A nickel and 10 pennies</li>
<li>2 nickels e 5 pennies</li>
<li>Um nickel e 10 pennies</li>
<li>15 pennies</li>
</ul>
# --instructions--
Implement a function to determine how many ways there are to make change for a given input, `cents`, that represents an amount of US pennies using these common coins.
Implemente uma função para determinar quantas maneiras há para fazer troco para uma determinada entrada, `cents`, que representa uma quantidade de centavos americanos usando essas moedas comuns.
# --hints--
`countCoins` should be a function.
`countCoins` deve ser uma função.
```js
assert(typeof countCoins === 'function');
```
`countCoins(15)` should return `6`.
`countCoins(15)` deve retornar `6`.
```js
assert.equal(countCoins(15), 6);
```
`countCoins(85)` shouls return `163`.
`countCoins(85)` deve retornar `163`.
```js
assert.equal(countCoins(85), 163);
```
`countCoins(100)` should return `242`.
`countCoins(100)` deve retornar `242`.
```js
assert.equal(countCoins(100), 242);

View File

@ -1,6 +1,6 @@
---
id: 59713da0a428c1a62d7db430
title: Cramer's rule
title: A regra de Cramer
challengeType: 5
forumTopicId: 302239
dashedName: cramers-rule
@ -8,43 +8,43 @@ dashedName: cramers-rule
# --description--
In [linear algebra](https://en.wikipedia.org/wiki/linear algebra "wp: linear algebra"), [Cramer's rule](https://en.wikipedia.org/wiki/Cramer's rule "wp: Cramer's rule") is an explicit formula for the solution of a [system of linear equations](https://en.wikipedia.org/wiki/system of linear equations "wp: system of linear equations") with as many equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the vector of right hand sides of the equations.
Em [álgebra linear](https://en.wikipedia.org/wiki/linear algebra "wp: linear algebra"), a [Regra de Cramer](https://en.wikipedia.org/wiki/Cramer's rule "wp: Cramer's rule") é uma fórmula explícita para a solução de um [sistema de equações lineares](https://en.wikipedia.org/wiki/system of linear equations "wp: system of linear equations") com tantas equações quanto variáveis. Essa regra é válida sempre que o sistema tiver uma solução única. Ela exprime a solução em termos dos determinantes da matriz do coeficiente (quadrada) e de matrizes obtidas a partir dela substituindo uma coluna pelo vetor da direita das equações.
Given
Dado
$\\left\\{\\begin{matrix}a_1x + b_1y + c_1z&= {\\color{red}d_1}\\\\a_2x + b_2y + c_2z&= {\\color{red}d_2}\\\\a_3x + b_3y + c_3z&= {\\color{red}d_3}\\end{matrix}\\right.$
which in matrix format is
que no formato de matriz é
$\\begin{bmatrix} a_1 & b_1 & c_1 \\\\ a_2 & b_2 & c_2 \\\\ a_3 & b_3 & c_3 \\end{bmatrix}\\begin{bmatrix} x \\\\ y \\\\ z \\end{bmatrix}=\\begin{bmatrix} {\\color{red}d_1} \\\\ {\\color{red}d_2} \\\\ {\\color{red}d_3} \\end{bmatrix}.$
Then the values of $x, y$ and $z$ can be found as follows:
Então, os valores de $x, y$ e $z$ podem ser encontrados da seguinte forma:
$x = \\frac{\\begin{vmatrix} {\\color{red}d_1} & b_1 & c_1 \\\\ {\\color{red}d_2} & b_2 & c_2 \\\\ {\\color{red}d_3} & b_3 & c_3 \\end{vmatrix} } { \\begin{vmatrix} a_1 & b_1 & c_1 \\\\ a_2 & b_2 & c_2 \\\\ a_3 & b_3 & c_3 \\end{vmatrix}}, \\quad y = \\frac {\\begin{vmatrix} a_1 & {\\color{red}d_1} & c_1 \\\\ a_2 & {\\color{red}d_2} & c_2 \\\\ a_3 & {\\color{red}d_3} & c_3 \\end{vmatrix}} {\\begin{vmatrix} a_1 & b_1 & c_1 \\\\ a_2 & b_2 & c_2 \\\\ a_3 & b_3 & c_3 \\end{vmatrix}}, \\text{ and }z = \\frac { \\begin{vmatrix} a_1 & b_1 & {\\color{red}d_1} \\\\ a_2 & b_2 & {\\color{red}d_2} \\\\ a_3 & b_3 & {\\color{red}d_3} \\end{vmatrix}} {\\begin{vmatrix} a_1 & b_1 & c_1 \\\\ a_2 & b_2 & c_2 \\\\ a_3 & b_3 & c_3 \\end{vmatrix} }.$
# --instructions--
Given the following system of equations:
Dado o seguinte sistema de equações:
$\\begin{cases} 2w-x+5y+z=-3 \\\\ 3w+2x+2y-6z=-32 \\\\ w+3x+3y-z=-47 \\\\ 5w-2x-3y+3z=49 \\\\ \\end{cases}$
solve for $w$, $x$, $y$ and $z$, using Cramer's rule.
resolva para as variáveis $w$, $x$, $y$ e $z$ usando a Regra de Cramer.
# --hints--
`cramersRule` should be a function.
`cramersRule` deve ser uma função.
```js
assert(typeof cramersRule === 'function');
```
`cramersRule([[2, -1, 5, 1], [3, 2, 2, -6], [1, 3, 3, -1], [5, -2, -3, 3]], [-3, -32, -47, 49])` should return `[2, -12, -4, 1]`.
`cramersRule([[2, -1, 5, 1], [3, 2, 2, -6], [1, 3, 3, -1], [5, -2, -3, 3]], [-3, -32, -47, 49])` deve retornar `[2, -12, -4, 1]`.
```js
assert.deepEqual(cramersRule(matrices[0], freeTerms[0]), answers[0]);
```
`cramersRule([[3, 1, 1], [2, 2, 5], [1, -3, -4]], [3, -1, 2])` should return `[1, 1, -1]`.
`cramersRule([[3, 1, 1], [2, 2, 5], [1, -3, -4]], [3, -1, 2])` deve retornar `[1, 1, -1]`.
```js
assert.deepEqual(cramersRule(matrices[1], freeTerms[1]), answers[1]);

View File

@ -1,6 +1,6 @@
---
id: 5a23c84252665b21eecc7e03
title: Cumulative standard deviation
title: Desvio padrão acumulado
challengeType: 5
forumTopicId: 302240
dashedName: cumulative-standard-deviation
@ -8,41 +8,41 @@ dashedName: cumulative-standard-deviation
# --description--
Write a function that takes an array of numbers as parameter and returns the [standard deviation](https://en.wikipedia.org/wiki/Standard Deviation) of the series.
Escreva uma função que recebe um array de números como parâmetro e retorna o [desvio padrão](https://pt.wikipedia.org/wiki/Desvio_padr%C3%A3o) da série.
# --hints--
`standardDeviation` should be a function.
`standardDeviation` deve ser uma função.
```js
assert(typeof standardDeviation == 'function');
```
`standardDeviation([2, 4, 4, 4, 5, 5, 7, 9])` should return a number.
`standardDeviation([2, 4, 4, 4, 5, 5, 7, 9])` deve retornar um número.
```js
assert(typeof standardDeviation([2, 4, 4, 4, 5, 5, 7, 9]) == 'number');
```
`standardDeviation([2, 4, 4, 4, 5, 5, 7, 9])` should return `2`.
`standardDeviation([2, 4, 4, 4, 5, 5, 7, 9])` deve retornar `2`.
```js
assert.equal(standardDeviation([2, 4, 4, 4, 5, 5, 7, 9]), 2);
```
`standardDeviation([600, 470, 170, 430, 300])` should return `147.323`.
`standardDeviation([600, 470, 170, 430, 300])` deve retornar `147.323`.
```js
assert.equal(standardDeviation([600, 470, 170, 430, 300]), 147.323);
```
`standardDeviation([75, 83, 96, 100, 121, 125])` should return `18.239`.
`standardDeviation([75, 83, 96, 100, 121, 125])` deve retornar `18.239`.
```js
assert.equal(standardDeviation([75, 83, 96, 100, 121, 125]), 18.239);
```
`standardDeviation([23, 37, 45, 49, 56, 63, 63, 70, 72, 82])` should return `16.87`.
`standardDeviation([23, 37, 45, 49, 56, 63, 63, 70, 72, 82])` deve retornar `16.87`.
```js
assert.equal(
@ -51,7 +51,7 @@ assert.equal(
);
```
`standardDeviation([271, 354, 296, 301, 333, 326, 285, 298, 327, 316, 287, 314])` should return `22.631`.
`standardDeviation([271, 354, 296, 301, 333, 326, 285, 298, 327, 316, 287, 314])` deve retornar `22.631`.
```js
assert.equal(