chore(i18n,curriculum): update translations (#43178)
This commit is contained in:
@ -23,7 +23,7 @@ Conway forneceu um programa para números primos em FRACTRAN:
|
||||
|
||||
$\\dfrac{17}{91}$, $\\dfrac{78}{85}$, $\\dfrac{19}{51}$, $\\dfrac{23}{38}$, $\\dfrac{29}{33}$, $\\dfrac{77}{29}$, $\\dfrac{95}{23}$, $\\dfrac{77}{19}$, $\\dfrac{1}{17}$, $\\dfrac{11}{13}$, $\\dfrac{13}{11}$, $\\dfrac{15}{14}$, $\\dfrac{15}{2}$, $\\dfrac{55}{1}$
|
||||
|
||||
Começando com $n=2$, este programa em FRACTRAN mudará $n$ para $15=2\\vezes (\\frac{15}{2})$, então $825=15\\vezes (\\frac{55}{1})$, gerando a seguinte sequência de inteiros:
|
||||
Começando com $n=2$, este programa em FRACTRAN mudará $n$ para $15=2\\times (\\frac{15}{2})$, então $825=15\\times (\\frac{55}{1})$, gerando a seguinte sequência de inteiros:
|
||||
|
||||
$2$, $15$, $825$, $725$, $1925$, $2275$, $425$, $390$, $330$, $290$, $770$, $\\ldots$
|
||||
|
||||
|
@ -10,7 +10,7 @@ dashedName: gaussian-elimination
|
||||
|
||||
Escreva uma função para calcular \\(Ax = b\\) usando a eliminação gaussiana e, em seguida, a substituição reversa.
|
||||
|
||||
\\(A\\) sendo uma matriz \\(n \\vezes n\\). Além disso, \\(x\\) e \\(b\\) são vetores \\(n\\) por 1.
|
||||
\\(A\\) sendo uma matriz \\(n \\times n\\). Além disso, \\(x\\) e \\(b\\) são vetores \\(n\\) por 1.
|
||||
|
||||
Para melhorar a precisão, use pivô parcial e escala.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5a23c84252665b21eecc7eb1
|
||||
title: Identity matrix
|
||||
title: Matriz identidade
|
||||
challengeType: 5
|
||||
forumTopicId: 302290
|
||||
dashedName: identity-matrix
|
||||
@ -8,7 +8,7 @@ dashedName: identity-matrix
|
||||
|
||||
# --description--
|
||||
|
||||
An *identity matrix* is a square matrix of size \\( n \\times n \\), where the diagonal elements are all `1`s (ones), and all the other elements are all `0`s (zeroes).
|
||||
Uma *matriz identidade* é uma matriz quadrada de tamanho \\( n \\times n \\), onde os elementos diagonais são todos `1` (um) e todos os outros elementos são `0`(zero).
|
||||
|
||||
<ul>
|
||||
<li style='list-style: none;'>\(\displaystyle I_{n}=\begin{bmatrix} 1 & 0 & 0 \cr 0 & 1 & 0 \cr 0 & 0 & 1 \cr \end{bmatrix}\)</li>
|
||||
@ -16,41 +16,41 @@ An *identity matrix* is a square matrix of size \\( n \\times n \\), where the d
|
||||
|
||||
# --instructions--
|
||||
|
||||
Write a function that takes a number `n` as a parameter and returns the identity matrix of order \\( n \\times n \\).
|
||||
Escreva uma função que recebe um número `n` como um parâmetro e retorna a matriz identidade de ordem \\( n \\times n \\).
|
||||
|
||||
# --hints--
|
||||
|
||||
`idMatrix` should be a function.
|
||||
`idMatrix` deve ser uma função.
|
||||
|
||||
```js
|
||||
assert(typeof idMatrix == 'function');
|
||||
```
|
||||
|
||||
`idMatrix(1)` should return an array.
|
||||
`idMatrix(1)` deve retornar um array.
|
||||
|
||||
```js
|
||||
assert(Array.isArray(idMatrix(1)));
|
||||
```
|
||||
|
||||
`idMatrix(1)` should return `[ [ 1 ] ]`.
|
||||
`idMatrix(1)` deve retornar `[ [ 1 ] ]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(idMatrix(1), results[0]);
|
||||
```
|
||||
|
||||
`idMatrix(2)` should return `[ [ 1, 0 ], [ 0, 1 ] ]`.
|
||||
`idMatrix(2)` deve retornar `[ [ 1, 0 ], [ 0, 1 ] ]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(idMatrix(2), results[1]);
|
||||
```
|
||||
|
||||
`idMatrix(3)` should return `[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]`.
|
||||
`idMatrix(3)` deve retornar `[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(idMatrix(3), results[2]);
|
||||
```
|
||||
|
||||
`idMatrix(4)` should return `[ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ]`.
|
||||
`idMatrix(4)` deve retornar `[ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(idMatrix(4), results[3]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5a23c84252665b21eecc7ec1
|
||||
title: Iterated digits squaring
|
||||
title: Elevar ao quadrado os dígitos iterados
|
||||
challengeType: 5
|
||||
forumTopicId: 302291
|
||||
dashedName: iterated-digits-squaring
|
||||
@ -8,7 +8,7 @@ dashedName: iterated-digits-squaring
|
||||
|
||||
# --description--
|
||||
|
||||
If you add the square of the digits of a Natural number (an integer bigger than zero), you always end with either 1 or 89:
|
||||
Se você somar o quadrado dos dígitos de um número natural (um número inteiro maior que zero), você sempre terminará com 1 ou 89:
|
||||
|
||||
<pre>15 -> 26 -> 40 -> 16 -> 37 -> 58 -> 89
|
||||
7 -> 49 -> 97 -> 130 -> 10 -> 1
|
||||
@ -16,53 +16,53 @@ If you add the square of the digits of a Natural number (an integer bigger than
|
||||
|
||||
# --instructions--
|
||||
|
||||
Write a function that takes a number as a parameter and returns 1 or 89 after performing the mentioned process.
|
||||
Escreva uma função que receba um número na forma de um parâmetro e retorne 1 ou 89 depois de executar o processo mencionado.
|
||||
|
||||
# --hints--
|
||||
|
||||
`iteratedSquare` should be a function.
|
||||
`iteratedSquare` deve ser uma função.
|
||||
|
||||
```js
|
||||
assert(typeof iteratedSquare == 'function');
|
||||
```
|
||||
|
||||
`iteratedSquare(4)` should return a number.
|
||||
`iteratedSquare(4)` deve retornar um número.
|
||||
|
||||
```js
|
||||
assert(typeof iteratedSquare(4) == 'number');
|
||||
```
|
||||
|
||||
`iteratedSquare(4)` should return `89`.
|
||||
`iteratedSquare(4)` deve retornar `89`.
|
||||
|
||||
```js
|
||||
assert.equal(iteratedSquare(4), 89);
|
||||
```
|
||||
|
||||
`iteratedSquare(7)` should return `1`.
|
||||
`iteratedSquare(7)` deve retornar `1`.
|
||||
|
||||
```js
|
||||
assert.equal(iteratedSquare(7), 1);
|
||||
```
|
||||
|
||||
`iteratedSquare(15)` should return `89`.
|
||||
`iteratedSquare(15)` deve retornar `89`.
|
||||
|
||||
```js
|
||||
assert.equal(iteratedSquare(15), 89);
|
||||
```
|
||||
|
||||
`iteratedSquare(20)` should return `89`.
|
||||
`iteratedSquare(20)` deve retornar `89`.
|
||||
|
||||
```js
|
||||
assert.equal(iteratedSquare(20), 89);
|
||||
```
|
||||
|
||||
`iteratedSquare(70)` should return `1`.
|
||||
`iteratedSquare(70)` deve retornar `1`.
|
||||
|
||||
```js
|
||||
assert.equal(iteratedSquare(70), 1);
|
||||
```
|
||||
|
||||
`iteratedSquare(100)` should return `1`.
|
||||
`iteratedSquare(100)` deve retornar `1`.
|
||||
|
||||
```js
|
||||
assert.equal(iteratedSquare(100), 1);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5a23c84252665b21eecc7ec2
|
||||
title: Jaro distance
|
||||
title: Distância de Jaro
|
||||
challengeType: 5
|
||||
forumTopicId: 302292
|
||||
dashedName: jaro-distance
|
||||
@ -8,28 +8,28 @@ dashedName: jaro-distance
|
||||
|
||||
# --description--
|
||||
|
||||
The Jaro distance is a measure of similarity between two strings. The higher the Jaro distance for two strings is, the more similar the strings are. The score is normalized such that `0` equates to no similarity and `1` is an exact match.
|
||||
A distância de Jaro é uma medida de semelhança entre duas strings. Quanto maior a distância de Jaro entre as duas strings, mais parecidas elas são. A pontuação é normalizada, de modo que `0` é igual a nenhuma similaridade e `1` é uma correspondência exata.
|
||||
|
||||
**Definition**
|
||||
**Definição**
|
||||
|
||||
The Jaro distance \\( d_j \\) of two given strings \\(s_1\\) and \\(s_2\\) is
|
||||
A distância de Jaro \\( d_j \\) de duas strings fornecidas \\(s_1\\) e \\(s_2\\) é
|
||||
|
||||
\\begin{align}d_j = \\begin{cases}0& & \\text{if }m=0 \\\\\\\\{\\frac {1}{3}}\\left({\\frac {m}{|s\_{1}|}}+{\\frac {m}{|s\_{2}|}}+{\\frac {m-t}{m}}\\right)& & \\text{otherwise}\\end{cases}\\end{align}
|
||||
|
||||
Where:
|
||||
Onde:
|
||||
|
||||
<ul>
|
||||
<li>\(m\) is the number of <i>matching characters</i>;</li>
|
||||
<li> \(t\) is half the number of <i>transpositions</i>.</li>
|
||||
<li>\(m\) é o número de <i>caracteres correspondentes</i>;</li>
|
||||
<li> \(t\) é a metade do número de <i>transposições</i>.</li>
|
||||
</ul>
|
||||
|
||||
Two characters from \\(s_1\\) and \\(s_2\\) respectively, are considered *matching* only if they are the same and not farther than \\(\\left\\lfloor\\frac{\\max(|s_1|,|s_2|)}{2}\\right\\rfloor-1\\).
|
||||
Dois caracteres de \\(s_1\\) e \\(s_2\\), respectivamente, são considerados *correspondentes* somente se forem iguais e não mais distante do que \\(\\left\\lfloor\\frac{\\max(|s_1|,|s_2|)}{2}\\right\\rfloor-1\\).
|
||||
|
||||
Each character of \\(s_1\\) is compared with all its matching characters in \\(s_2\\) . The number of matching (but different sequence order) characters divided by 2 defines the number of *transpositions*.
|
||||
Cada caractere de \\(s_1\\) é comparado com todos os seus caracteres correspondentes em \\(s_2\\) . O número de caracteres correspondentes (mas em ordem sequencial diferente) dividido por 2 define o número de *transposições*.
|
||||
|
||||
**Example**
|
||||
**Exemplo**
|
||||
|
||||
Given the strings \\(s_1\\) *DWAYNE* and \\(s_2\\) *DUANE* we find:
|
||||
Dadas as strings \\(s_1\\) *DWAYNE* e \\(s_2\\) *DUANE*, encontramos:
|
||||
|
||||
<ul>
|
||||
<li>\(m = 4\)</li>
|
||||
@ -38,51 +38,51 @@ Given the strings \\(s_1\\) *DWAYNE* and \\(s_2\\) *DUANE* we find:
|
||||
<li>\(t = 0\)</li>
|
||||
</ul>
|
||||
|
||||
We find a Jaro score of: \\(d_j = \\frac{1}{3}\\left(\\frac{4}{6} + \\frac{4}{5} + \\frac{4-0}{4}\\right) = 0.822\\).
|
||||
Encontramos uma pontuação de Jaro de: \\(d_j = \\frac{1}{3}\\left(\\frac{4}{6} + \\frac{4}{5} + \\frac{4-0}{4}\\right) = 0.822\\).
|
||||
|
||||
# --instructions--
|
||||
|
||||
Write a function a that takes two strings as parameters and returns the associated Jaro distance.
|
||||
Escreva uma função que receba duas strings como parâmetros e retorne a distância de Jaro associada.
|
||||
|
||||
# --hints--
|
||||
|
||||
`jaro` should be a function.
|
||||
`jaro` deve ser uma função.
|
||||
|
||||
```js
|
||||
assert(typeof jaro == 'function');
|
||||
```
|
||||
|
||||
`jaro("MARTHA", "MARHTA")` should return a number.
|
||||
`jaro("MARTHA", "MARHTA")` deve retornar um número.
|
||||
|
||||
```js
|
||||
assert(typeof jaro('MARTHA', 'MARHTA') == 'number');
|
||||
```
|
||||
|
||||
`jaro("MARTHA", "MARHTA")` should return `0.9444444444444445`.
|
||||
`jaro("MARTHA", "MARHTA")` deve retornar `0.9444444444444445`.
|
||||
|
||||
```js
|
||||
assert.equal(jaro('MARTHA', 'MARHTA'), 0.9444444444444445);
|
||||
```
|
||||
|
||||
`jaro("DIXON", "DICKSONX")` should return `0.7666666666666666`.
|
||||
`jaro("DIXON", "DICKSONX")` deve retornar `0.7666666666666666`.
|
||||
|
||||
```js
|
||||
assert.equal(jaro('DIXON', 'DICKSONX'), 0.7666666666666666);
|
||||
```
|
||||
|
||||
`jaro("JELLYFISH", "SMELLYFISH")` should return `0.8962962962962964`.
|
||||
`jaro("JELLYFISH", "SMELLYFISH")` deve retornar `0.8962962962962964`.
|
||||
|
||||
```js
|
||||
assert.equal(jaro('JELLYFISH', 'SMELLYFISH'), 0.8962962962962964);
|
||||
```
|
||||
|
||||
`jaro("HELLOS", "CHELLO")` should return `0.888888888888889`.
|
||||
`jaro("HELLOS", "CHELLO")` deve retornar `0.888888888888889`.
|
||||
|
||||
```js
|
||||
assert.equal(jaro('HELLOS', 'CHELLO'), 0.888888888888889);
|
||||
```
|
||||
|
||||
`jaro("ABCD", "BCDA")` should return `0.8333333333333334`.
|
||||
`jaro("ABCD", "BCDA")` deve retornar `0.8333333333333334`.
|
||||
|
||||
```js
|
||||
assert.equal(jaro('ABCD', 'BCDA'), 0.8333333333333334);
|
||||
|
@ -8,55 +8,55 @@ dashedName: jortsort
|
||||
|
||||
# --description--
|
||||
|
||||
jortSort is a sorting toolset that makes the user do the work and guarantees efficiency because you don't have to sort ever again. It was originally presented by Jenn "Moneydollars" Schiffer at the prestigious [JSConf](https://www.youtube.com/watch?v=pj4U_W0OFoE).
|
||||
jortSort é um conjunto de ferramentas de ordenação que faz com que o usuário faça o trabalho e garante a eficiência porque você não tem que organizar novamente. Ele foi apresentado originalmente por Jenn "Moneydollars" Schiffer na prestigiada conferência [JSConf](https://www.youtube.com/watch?v=pj4U_W0OFoE).
|
||||
|
||||
jortSort should be a function that takes a single array of comparable objects as its argument. It then sorts the array in ascending order and compares the sorted array to the originally provided array. If the arrays match (i.e. the original array was already sorted), the function returns true. If the arrays do not match (i.e. the original array was not sorted), the function returns false.
|
||||
jortSort deve ser uma função que recebe um único array de objetos comparáveis como argumento. Ela ordena o array em ordem ascendente e compara o array ordenado ao array fornecido inicialmente. Se os arrays corresponderem (ou seja, se o array original já foi ordenado), a função retorna true. Se os arrays não corresponderem (ou seja, se o array original não estiver ordenado), a função retorna false.
|
||||
|
||||
# --hints--
|
||||
|
||||
`jortsort` should be a function.
|
||||
`jortsort` deve ser uma função.
|
||||
|
||||
```js
|
||||
assert(typeof jortsort == 'function');
|
||||
```
|
||||
|
||||
`jortsort([1,2,3,4,5])` should return a boolean.
|
||||
`jortsort([1,2,3,4,5])` deve retornar um booleano.
|
||||
|
||||
```js
|
||||
assert(typeof jortsort([1, 2, 3, 4, 5]) == 'boolean');
|
||||
```
|
||||
|
||||
`jortsort([1,2,3,4,5])` should return `true`.
|
||||
`jortsort([1,2,3,4,5])` deve retornar `true`.
|
||||
|
||||
```js
|
||||
assert.equal(jortsort([1, 2, 3, 4, 5]), true);
|
||||
```
|
||||
|
||||
`jortsort([1,2,13,4,5])` should return `false`.
|
||||
`jortsort([1,2,13,4,5])` deve retornar `false`.
|
||||
|
||||
```js
|
||||
assert.equal(jortsort([1, 2, 13, 4, 5]), false);
|
||||
```
|
||||
|
||||
`jortsort([12,4,51,2,4])` should return `false`.
|
||||
`jortsort([12,4,51,2,4])` deve retornar `false`.
|
||||
|
||||
```js
|
||||
assert.equal(jortsort([12, 4, 51, 2, 4]), false);
|
||||
```
|
||||
|
||||
`jortsort([1,2])` should return `true`.
|
||||
`jortsort([1,2])` deve retornar `true`.
|
||||
|
||||
```js
|
||||
assert.equal(jortsort([1, 2]), true);
|
||||
```
|
||||
|
||||
`jortsort([5,4,3,2,1])` should return `false`.
|
||||
`jortsort([5,4,3,2,1])` deve retornar `false`.
|
||||
|
||||
```js
|
||||
assert.equal(jortsort([5, 4, 3, 2, 1]), false);
|
||||
```
|
||||
|
||||
`jortsort([1,1,1,1,1])` should return `true`.
|
||||
`jortsort([1,1,1,1,1])` deve retornar `true`.
|
||||
|
||||
```js
|
||||
assert.equal(jortsort([1, 1, 1, 1, 1]), true);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5a23c84252665b21eecc7ec5
|
||||
title: Josephus problem
|
||||
title: O problema de Josephus
|
||||
challengeType: 5
|
||||
forumTopicId: 302294
|
||||
dashedName: josephus-problem
|
||||
@ -8,65 +8,65 @@ dashedName: josephus-problem
|
||||
|
||||
# --description--
|
||||
|
||||
[Josephus problem](https://en.wikipedia.org/wiki/Josephus problem) is a math puzzle with a grim description: $n$ prisoners are standing on a circle, sequentially numbered from $0$ to $n-1$.
|
||||
O [problema de Josephus](https://en.wikipedia.org/wiki/Josephus problem) é um desafio de matemática com uma descrição macabra: $n$ prisoneiros estão de pé, em círculo, sequencialmente numerados de $0$ a $n-1$.
|
||||
|
||||
An executioner walks along the circle, starting from prisoner $0$, removing every $k$-th prisoner and killing him.
|
||||
Um carrasco caminha pelo círculo, começando pelo prisioneiro $0$, removendo cada $k$-ésimo prisioneiro e matando-o.
|
||||
|
||||
As the process goes on, the circle becomes smaller and smaller, until only one prisoner remains, who is then freed.
|
||||
À medida que o processo avança, o círculo torna-se cada vez menor, até ficar apenas um prisioneiro, que é depois libertado.
|
||||
|
||||
For example, if there are $n=5$ prisoners and $k=2$, the order the prisoners are killed in (let's call it the "killing sequence") will be 1, 3, 0, and 4, and the survivor will be #2.
|
||||
Por exemplo, se houver $n=5$ prisioneiros e $k=2$, a ordem em que os prisioneiros são mortos (vamos chamá-la de "sequência de morte") será 1, 3, 0 e 4. O sobrevivente, então, será o nº 2.
|
||||
|
||||
Given any $n, k > 0$, find out which prisoner will be the final survivor.
|
||||
Dado qualquer $n, sendo k > 0$, descubra qual prisioneiro será o sobrevivente ao final.
|
||||
|
||||
In one such incident, there were 41 prisoners and every 3<sup>rd</sup> prisoner was being killed ($k=3$).
|
||||
Em um incidente deste tipo, havia 41 prisoneiros e o 3<sup>o</sup> prisioneiro na sequência era morto ($k=3$).
|
||||
|
||||
Among them was a clever chap name Josephus who worked out the problem, stood at the surviving position, and lived on to tell the tale.
|
||||
Entre eles, havia um homem inteligente, chamado Josephus, que desvendou o problema, ficou na posição do sobrevivente e viveu para contar a história.
|
||||
|
||||
Which number was he?
|
||||
Qual era o número dele?
|
||||
|
||||
# --instructions--
|
||||
|
||||
Write a function that takes the initial number of prisoners and 'k' as parameter and returns the number of the prisoner that survives.
|
||||
Escreva uma função que recebe o número inicial de prisioneiros e 'k' como parâmetros, devolvendo o número do prisioneiro que sobrevive.
|
||||
|
||||
# --hints--
|
||||
|
||||
`josephus` should be a function.
|
||||
`josephus` deve ser uma função.
|
||||
|
||||
```js
|
||||
assert(typeof josephus == 'function');
|
||||
```
|
||||
|
||||
`josephus(30,3)` should return a number.
|
||||
`josephus(30,3)` deve retornar um número.
|
||||
|
||||
```js
|
||||
assert(typeof josephus(30, 3) == 'number');
|
||||
```
|
||||
|
||||
`josephus(30,3)` should return `28`.
|
||||
`josephus(30,3)` deve retornar `28`.
|
||||
|
||||
```js
|
||||
assert.equal(josephus(30, 3), 28);
|
||||
```
|
||||
|
||||
`josephus(30,5)` should return `2`.
|
||||
`josephus(30,5)` deve retornar `2`.
|
||||
|
||||
```js
|
||||
assert.equal(josephus(30, 5), 2);
|
||||
```
|
||||
|
||||
`josephus(20,2)` should return `8`.
|
||||
`josephus(20,2)` deve retornar `8`.
|
||||
|
||||
```js
|
||||
assert.equal(josephus(20, 2), 8);
|
||||
```
|
||||
|
||||
`josephus(17,6)` should return `1`.
|
||||
`josephus(17,6)` deve retornar `1`.
|
||||
|
||||
```js
|
||||
assert.equal(josephus(17, 6), 1);
|
||||
```
|
||||
|
||||
`josephus(29,4)` should return `1`.
|
||||
`josephus(29,4)` deve retornar `1`.
|
||||
|
||||
```js
|
||||
assert.equal(josephus(29, 4), 1);
|
||||
|
Reference in New Issue
Block a user