chore(i18n,learn): processed translations (#45068)

pull/45073/merge
camperbot 2022-02-10 23:37:28 +05:30 committed by GitHub
parent 5f06b7805c
commit 1957ec6cdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 91 deletions

View File

@ -1,6 +1,6 @@
---
id: 5a23c84252665b21eecc7e1e
title: Dot product
title: Prodotto scalare
challengeType: 5
forumTopicId: 302251
dashedName: dot-product
@ -8,47 +8,47 @@ dashedName: dot-product
# --description--
Create a function, to compute the **[dot product](https://en.wikipedia.org/wiki/Dot product)**, also known as the **scalar product** of two vectors.
Crea una funzione per calcolare il **[prodotto scalare](https://en.wikipedia.org/wiki/Dot product)** di due vettori.
# --hints--
`dotProduct` should be a function.
`dotProduct` dovrebbe essere una funzione.
```js
assert(typeof dotProduct == 'function');
```
`dotProduct([1, 3, -5], [4, -2, -1])` should return a number.
`dotProduct([1, 3, -5], [4, -2, -1])` dovrebbe restituire un numero.
```js
assert(typeof dotProduct([1, 3, -5], [4, -2, -1]) == 'number');
```
`dotProduct([1, 3, -5], [4, -2, -1])` should return `3`.
`dotProduct([1, 3, -5], [4, -2, -1])` dovrebbe restituire `3`.
```js
assert.equal(dotProduct([1, 3, -5], [4, -2, -1]), 3);
```
`dotProduct([1, 2, 3, 4, 5], [6, 7, 8, 9, 10])` should return `130`.
`dotProduct([1, 2, 3, 4, 5], [6, 7, 8, 9, 10])` dovrebbe restituire `130`.
```js
assert.equal(dotProduct([1, 2, 3, 4, 5], [6, 7, 8, 9, 10]), 130);
```
`dotProduct([5, 4, 3, 2], [7, 8, 9, 6])` should return `106`.
`dotProduct([5, 4, 3, 2], [7, 8, 9, 6])` dovrebbe restituire `106`.
```js
assert.equal(dotProduct([5, 4, 3, 2], [7, 8, 9, 6]), 106);
```
`dotProduct([-5, 4, -3, 2], [-7, -8, 9, -6])` should return `-36`.
`dotProduct([-5, 4, -3, 2], [-7, -8, 9, -6])` dovrebbe restituire `-36`.
```js
assert.equal(dotProduct([-5, 4, -3, 2], [-7, -8, 9, -6]), -36);
```
`dotProduct([17, 27, 34, 43, 15], [62, 73, 48, 95, 110])` should return `10392`.
`dotProduct([17, 27, 34, 43, 15], [62, 73, 48, 95, 110])` dovrebbe restituire `10392`.
```js
assert.equal(dotProduct([17, 27, 34, 43, 15], [62, 73, 48, 95, 110]), 10392);

View File

@ -1,6 +1,6 @@
---
id: 599c333915e0ea32d04d4bec
title: Element-wise operations
title: Implementare operazioni sulle matrici
challengeType: 5
forumTopicId: 302252
dashedName: element-wise-operations
@ -8,29 +8,29 @@ dashedName: element-wise-operations
# --description--
Implement basic element-wise matrix-matrix and scalar-matrix operations.
Implementa operazioni matrice-matrice e scalare-matrice.
**Implement:**
**Implementa:**
<ul>
<li>addition</li>
<li>subtraction</li>
<li>multiplication</li>
<li>division</li>
<li>exponentiation</li>
<li>addizione (add)</li>
<li>sottrazione (sub)</li>
<li>moltiplicazione (mult)</li>
<li>divisione (div)</li>
<li>esponenziazione (exp)</li>
</ul>
The first parameter will be the operation to be performed, for example, "m_add" for matrix addition and "s_add" for scalar addition. The second and third parameters will be the matrices on which the operations are to be performed.
Il primo parametro sarà l'operazione da eseguire, per esempio, "m_add" per addizione matriciale e "s_add" per addizione scalare. Il secondo e terzo paramentro saranno le matrici su cui fare le operazioni.
# --hints--
`operation` should be a function.
`operation` dovrebbe essere una funzione.
```js
assert(typeof operation === 'function');
```
`operation("m_add",[[1,2],[3,4]],[[1,2],[3,4]])` should return `[[2,4],[6,8]]`.
`operation("m_add",[[1,2],[3,4]],[[1,2],[3,4]])` dovrebbe restituire `[[2,4],[6,8]]`.
```js
assert.deepEqual(
@ -52,7 +52,7 @@ assert.deepEqual(
);
```
`operation("s_add",[[1,2],[3,4]],2)` should return `[[3,4],[5,6]]`.
`operation("s_add",[[1,2],[3,4]],2)` dovrebbe restituire `[[3,4],[5,6]]`.
```js
assert.deepEqual(
@ -71,7 +71,7 @@ assert.deepEqual(
);
```
`operation("m_sub",[[1,2],[3,4]],[[1,2],[3,4]])` should return `[[0,0],[0,0]]`.
`operation("m_sub",[[1,2],[3,4]],[[1,2],[3,4]])` dovrebbe restituire `[[0,0],[0,0]]`.
```js
assert.deepEqual(
@ -93,7 +93,7 @@ assert.deepEqual(
);
```
`operation("m_mult",[[1,2],[3,4]],[[1,2],[3,4]])` should return `[[1,4],[9,16]]`.
`operation("m_mult",[[1,2],[3,4]],[[1,2],[3,4]])` dovrebbe restituire `[[1,4],[9,16]]`.
```js
assert.deepEqual(
@ -115,7 +115,7 @@ assert.deepEqual(
);
```
`operation("m_div",[[1,2],[3,4]],[[1,2],[3,4]])` should return `[[1,1],[1,1]]`.
`operation("m_div",[[1,2],[3,4]],[[1,2],[3,4]])` dovrebbe restituire `[[1,1],[1,1]]`.
```js
assert.deepEqual(
@ -137,7 +137,7 @@ assert.deepEqual(
);
```
`operation("m_exp",[[1,2],[3,4]],[[1,2],[3,4]])` should return `[[1,4],[27,256]]`.
`operation("m_exp",[[1,2],[3,4]],[[1,2],[3,4]])` dovrebbe restituire `[[1,4],[27,256]]`.
```js
assert.deepEqual(
@ -159,7 +159,7 @@ assert.deepEqual(
);
```
`operation("m_add",[[1,2,3,4],[5,6,7,8]],[[9,10,11,12],[13,14,15,16]])` should return `[[10,12,14,16],[18,20,22,24]]`.
`operation("m_add",[[1,2,3,4],[5,6,7,8]],[[9,10,11,12],[13,14,15,16]])` dovrebbe restituire `[[10,12,14,16],[18,20,22,24]]`.
```js
assert.deepEqual(

View File

@ -1,6 +1,6 @@
---
id: 599d0ba974141b0f508b37d5
title: Emirp primes
title: Numeri primi emirp
challengeType: 5
forumTopicId: 302253
dashedName: emirp-primes
@ -8,30 +8,30 @@ dashedName: emirp-primes
# --description--
An emirp (**prime** spelled backwards) are primes that when reversed (in their decimal representation) are a different prime.
Gli emirp (numero primo in inglese, **prime**, scritto al contrario) sono primi che quando invertiti (nella loro rappresentazione decimale) sono un numero primo diverso.
# --instructions--
Write a function that:
Scrivi una funzione che:
<ul>
<li>Shows the first <code>n</code> emirp numbers.</li>
<li>Shows the emirp numbers in a range.</li>
<li>Shows the number of emirps in a range.</li>
<li>Shows the <code>n<sup>th</sup></code> emirp number.</li>
<li>Mostra i primi <code>n</code> numeri emirp.</li>
<li>Mostra i numeri emirp in un intervallo.</li>
<li>Mostra il numero di emirp presenti in un intervallo.</li>
<li>Mostra l'<code>n<sup>mo</sup></code> numero emirp.</li>
</ul>
The function should accept two parameters. The first will receive `n` or the range as an array. The second will receive a boolean, that specifies if the function returns the emirps as an array or a single number (the number of primes in the range or the <code>n<sup>th</sup></code> prime). According to the parameters the function should return an array or a number.
La funzione dovrebbe accettare due parametri. Il primo riceverà `n` o l'intervallo sotto forma di array. Il secondo riceverà un booleano, che specifica se la funzione restituisce gli emirp come array o un singolo numero (il numero di primi nell'intervallo o l'<code>n<sup>mo</sup></code> primo). A seconda dei parametri la funzione dovrebbe restituire un array o un numero.
# --hints--
`emirps` should be a function.
`emirps` dovrebbe essere una funzione.
```js
assert(typeof emirps === 'function');
```
`emirps(20,true)` should return `[13,17,31,37,71,73,79,97,107,113,149,157,167,179,199,311,337,347,359,389]`
`emirps(20,true)` dovrebbe restituire `[13,17,31,37,71,73,79,97,107,113,149,157,167,179,199,311,337,347,359,389]`
```js
assert.deepEqual(emirps(20, true), [
@ -58,13 +58,13 @@ assert.deepEqual(emirps(20, true), [
]);
```
`emirps(1000)` should return `70529`
`emirps(1000)` dovrebbe restituire `70529`
```js
assert.deepEqual(emirps(1000), 70529);
```
`emirps([7700,8000],true)` should return `[7717,7757,7817,7841,7867,7879,7901,7927,7949,7951,7963]`
`emirps([7700,8000],true)` dovrebbe restituire `[7717,7757,7817,7841,7867,7879,7901,7927,7949,7951,7963]`
```js
assert.deepEqual(emirps([7700, 8000], true), [
@ -82,7 +82,7 @@ assert.deepEqual(emirps([7700, 8000], true), [
]);
```
`emirps([7700,8000],false)` should return `11`
`emirps([7700,8000],false)` dovrebbe restituire `11`
```js
assert.deepEqual(emirps([7700, 8000], false), 11);

View File

@ -1,6 +1,6 @@
---
id: 599d15309e88c813a40baf58
title: Entropy
title: Entropia
challengeType: 5
forumTopicId: 302254
dashedName: entropy
@ -8,53 +8,53 @@ dashedName: entropy
# --description--
Calculate the Shannon entropy H of a given input string.
Calcola l'entropia H di Shannon di una data stringa.
Given the discreet random variable $X$ that is a string of $N$ "symbols" (total characters) consisting of $n$ different characters (n=2 for binary), the Shannon entropy of X in bits/symbol is:
Data la variabile casuale discreta $X$ che è una stringa di $N$ "simboli" (caratteri totali) composta da $n$ caratteri diversi (n=2 per il binario), l'entropia di Shannon di X in bit/simbolo è:
$H_2(X) = -\\sum\_{i=1}^n \\frac{count_i}{N} \\log_2 \\left(\\frac{count_i}{N}\\right)$
where $count_i$ is the count of character $n_i$.
dove $count_i$ è il conteggio dei caratteri $n_i$.
# --hints--
`entropy` should be a function.
`entropy` dovrebbe essere una funzione.
```js
assert(typeof entropy === 'function');
```
`entropy("0")` should return `0`
`entropy("0")` dovrebbe restituire `0`
```js
assert.equal(entropy('0'), 0);
```
`entropy("01")` should return `1`
`entropy("01")` dovrebbe restituire `1`
```js
assert.equal(entropy('01'), 1);
```
`entropy("0123")` should return `2`
`entropy("0123")` dovrebbe restituire `2`
```js
assert.equal(entropy('0123'), 2);
```
`entropy("01234567")` should return `3`
`entropy("01234567")` dovrebbe restituire `3`
```js
assert.equal(entropy('01234567'), 3);
```
`entropy("0123456789abcdef")` should return `4`
`entropy("0123456789abcdef")` dovrebbe restituire `4`
```js
assert.equal(entropy('0123456789abcdef'), 4);
```
`entropy("1223334444")` should return `1.8464393446710154`
`entropy("1223334444")` dovrebbe restituire `1.8464393446710154`
```js
assert.equal(entropy('1223334444'), 1.8464393446710154);

View File

@ -1,6 +1,6 @@
---
id: 5987fd532b954e0f21b5d3f6
title: Equilibrium index
title: Indice di equilibrio
challengeType: 5
forumTopicId: 302255
dashedName: equilibrium-index
@ -8,9 +8,9 @@ dashedName: equilibrium-index
# --description--
An equilibrium index of a sequence is an index into the sequence such that the sum of elements at lower indices is equal to the sum of elements at higher indices.
Un indice di equilibrio di una sequenza è un indice nella sequenza tale che la somma degli elementi a indici inferiori sia uguale alla somma degli elementi a indici più alti.
For example, in a sequence $A$:
Ad esempio, in una sequenza $A$:
<ul style='list-style: none;'>
<li><big>$A_0 = -7$</big></li>
@ -22,67 +22,67 @@ For example, in a sequence $A$:
<li><big>$A_6 = 0$</big></li>
</ul>
`3` is an equilibrium index, because:
`3` è un indice di equilibrio, perché:
<ul style='list-style: none;'>
<li><big>$A_0 + A_1 + A_2 = A_4 + A_5 + A_6$</big></li>
</ul>
`6` is also an equilibrium index, because:
`6` è anch'esso un indice di equilibrio, perché:
<ul style='list-style: none;'>
<li><big>$A_0 + A_1 + A_2 + A_3 + A_4 + A_5 = 0$</big></li>
</ul>
(sum of zero elements is zero)
(la somma di zero elementi è zero)
`7` is not an equilibrium index, because it is not a valid index of sequence $A$.
`7` non è un indice di equilibrio, perché non è un indice valido della sequenza $A$.
# --instructions--
Write a function that, given a sequence, returns its equilibrium indices (if any).
Scrivi una funzione che, data una sequenza, restituisce i suoi indici di equilibrio (se presenti).
Assume that the sequence may be very long.
Supponiamo che la sequenza possa essere molto lunga.
# --hints--
`equilibrium` should be a function.
`equilibrium` dovrebbe essere una funzione.
```js
assert(typeof equilibrium === 'function');
```
`equilibrium([-7, 1, 5, 2, -4, 3, 0])` should return `[3,6]`.
`equilibrium([-7, 1, 5, 2, -4, 3, 0])` dovrebbe restituire `[3,6]`.
```js
assert.deepEqual(equilibrium(equilibriumTests[0]), ans[0]);
```
`equilibrium([2, 4, 6])` should return `[]`.
`equilibrium([2, 4, 6])` dovrebbe restituire `[]`.
```js
assert.deepEqual(equilibrium(equilibriumTests[1]), ans[1]);
```
`equilibrium([2, 9, 2])` should return `[1]`.
`equilibrium([2, 9, 2])` dovrebbe restituire `[1]`.
```js
assert.deepEqual(equilibrium(equilibriumTests[2]), ans[2]);
```
`equilibrium([1, -1, 1, -1, 1, -1, 1])` should return `[0,1,2,3,4,5,6]`.
`equilibrium([1, -1, 1, -1, 1, -1, 1])` dovrebbe restituire `[0,1,2,3,4,5,6]`.
```js
assert.deepEqual(equilibrium(equilibriumTests[3]), ans[3]);
```
`equilibrium([1])` should return `[0]`.
`equilibrium([1])` dovrebbe restituire `[0]`.
```js
assert.deepEqual(equilibrium(equilibriumTests[4]), ans[4]);
```
`equilibrium([])` should return `[]`.
`equilibrium([])` dovrebbe restituire `[]`.
```js
assert.deepEqual(equilibrium(equilibriumTests[5]), ans[5]);

View File

@ -1,6 +1,6 @@
---
id: 599d1566a02b571412643b84
title: Ethiopian multiplication
title: Moltiplicazione etiope
challengeType: 5
forumTopicId: 302257
dashedName: ethiopian-multiplication
@ -8,24 +8,24 @@ dashedName: ethiopian-multiplication
# --description--
Ethiopian multiplication is a method of multiplying integers using only addition, doubling, and halving.
La moltiplicazione etiope è un metodo di moltiplicazione di numeri interi ottenuto utilizzando solo addizione, raddoppio e dimezzamento.
**Method:**
**Metodo:**
<ol>
<li>Take two numbers to be multiplied and write them down at the top of two columns</li>
<li>In the left-hand column repeatedly halve the last number, discarding any remainders, and write the result below the last in the same column, until you write a value of <code>1</code></li>
<li>In the right-hand column repeatedly double the last number and write the result below. stop when you add a result in the same row as where the left hand column shows <code>1</code></li>
<li>Examine the table produced and discard any row where the value in the left column is even</li>
<li>Sum the values in the right-hand column that remain to produce the result of multiplying the original two numbers together</li>
<li>Prendi due numeri da moltiplicare e scrivili in cima a due colonne</li>
<li>Nella colonna di sinistra dimezza ripetutamente l'ultimo numero, scartando eventuali resti, e scrivi il risultato sotto l'ultimo nella stessa colonna, finché non scrivi un valore di <code>1</code></li>
<li>Nella colonna di destra raddoppia ripetutamente l'ultimo numero e scrivere il risultato sotto. termina quando aggiungi un risultato nella stessa riga in cui la colonna di sinistra mostra <code>1</code></li>
<li>Esamina la tabella prodotta e scarta qualsiasi riga dove il valore nella colonna di sinistra è pari</li>
<li>Somma i valori nella colonna di destra che rimangono per produrre il risultato di moltiplicare tra di essi i due numeri originali</li>
</ol>
**For example:** `17 × 34`
**Per esempio:** `17 × 34`
<pre>17 34
</pre>
Halving the first column:
Dimezza la prima colonna:
<pre>17 34
8
@ -34,7 +34,7 @@ Halving the first column:
1
</pre>
Doubling the second column:
Raddoppia la seconda colonna:
<pre>17 34
8 68
@ -43,7 +43,7 @@ Doubling the second column:
1 544
</pre>
Strike-out rows whose first cell is even:
Elimina le righe la cui prima cella è pari:
<pre>17 34
8 <strike>68</strike>
@ -52,7 +52,7 @@ Strike-out rows whose first cell is even:
1 544
</pre>
Sum the remaining numbers in the right-hand column:
Somma i numeri rimanenti nella colonna di destra:
<!-- markdownlint-disable MD003 -->
@ -67,55 +67,55 @@ Sum the remaining numbers in the right-hand column:
<!-- markdownlint-enable MD003 -->
So `17` multiplied by `34`, by the Ethiopian method is `578`.
Quindi `17` moltiplicato per `34`, secondo il metodo etiope è `578`.
# --instructions--
The task is to define three named functions/methods/procedures/subroutines:
Il compito è quello di definire tre funzioni/metodi/procedure/subroutine denominati:
<ol>
<li>one to halve an integer,</li>
<li>one to double an integer, and</li>
<li>one to state if an integer is even</li>
<li>uno per dimezzare un numero intero,</li>
<li>uno per raddoppiare un numero intero, e</li>
<li>uno per indicare se un intero è pari</li>
</ol>
Use these functions to create a function that does Ethiopian multiplication.
Usa queste funzioni per creare una funzione che fa la moltiplicazione etiope.
<!-- markdownlint-disable MD046-->
# --hints--
`eth_mult` should be a function.
`eth_mult` dovrebbe essere una funzione.
```js
assert(typeof eth_mult === 'function');
```
`eth_mult(17,34)` should return `578`.
`eth_mult(17,34)` dovrebbe restituire `578`.
```js
assert.equal(eth_mult(17, 34), 578);
```
`eth_mult(23,46)` should return `1058`.
`eth_mult(23,46)` dovrebbe restituire `1058`.
```js
assert.equal(eth_mult(23, 46), 1058);
```
`eth_mult(12,27)` should return `324`.
`eth_mult(12,27)` dovrebbe restituire `324`.
```js
assert.equal(eth_mult(12, 27), 324);
```
`eth_mult(56,98)` should return `5488`.
`eth_mult(56,98)` dovrebbe restituire `5488`.
```js
assert.equal(eth_mult(56, 98), 5488);
```
`eth_mult(63,74)` should return `4662`.
`eth_mult(63,74)` dovrebbe restituire `4662`.
```js
assert.equal(eth_mult(63, 74), 4662);