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

This commit is contained in:
camperbot
2022-03-14 22:46:48 +05:30
committed by GitHub
parent 9a48c71ecf
commit d94177d85c
61 changed files with 592 additions and 335 deletions

View File

@ -1,6 +1,6 @@
---
id: a3f503de51cf954ede28891d
title: Find the Symmetric Difference
title: Encuentra la diferencia simétrica
challengeType: 5
forumTopicId: 301611
dashedName: find-the-symmetric-difference
@ -8,77 +8,77 @@ dashedName: find-the-symmetric-difference
# --description--
The mathematical term <dfn>symmetric difference</dfn> (`△` or `⊕`) of two sets is the set of elements which are in either of the two sets but not in both. For example, for sets `A = {1, 2, 3}` and `B = {2, 3, 4}`, `A △ B = {1, 4}`.
El término matemático <dfn>diferencia simétrica</dfn> (`△` or `⊕`) de dos conjuntos es el conjunto de elementos que están en cualquiera de los dos conjuntos, pero no en ambos. Por ejemplo, para los conjuntos `A = {1, 2, 3}` y `B = {2, 3, 4}`, `A △ B = {1, 4}`.
Symmetric difference is a binary operation, which means it operates on only two elements. So to evaluate an expression involving symmetric differences among *three* elements (`A △ B △ C`), you must complete one operation at a time. Thus, for sets `A` and `B` above, and `C = {2, 3}`, `A △ B △ C = (A △ B) △ C = {1, 4} △ {2, 3} = {1, 2, 3, 4}`.
Diferencia simétrica es una operación binaria, significa que opera en solo dos elementos. Entonces, para evaluar una expresión que involucra diferencias simétricas entre * tres * elementos (`A △ B △ C`), tienes que completar una operación a la vez. Asi, para los conjuntos `A` y `B` encima, y `C = {2, 3}`, `A △ B △ C = (A △ B) △ C = {1, 4} △ {2, 3} = {1, 2, 3, 4}`.
# --instructions--
Create a function that takes two or more arrays and returns an array of their symmetric difference. The returned array must contain only unique values (*no duplicates*).
Cree una función que tome dos o más arrays y devuelva una array de sus diferencias. La array que se devuelve debe contener solo valores únicos (*no duplicados*).
# --hints--
`sym([1, 2, 3], [5, 2, 1, 4])` should return `[3, 4, 5]`.
`sym([1, 2, 3], [5, 2, 1, 4])` debería retornar `[3, 4, 5]`.
```js
assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 4, 5]);
```
`sym([1, 2, 3], [5, 2, 1, 4])` should contain only three elements.
`sym([1, 2, 3], [5, 2, 1, 4])`debería contener solo tres elementos.
```js
assert.equal(sym([1, 2, 3], [5, 2, 1, 4]).length, 3);
```
`sym([1, 2, 3, 3], [5, 2, 1, 4])` should return `[3, 4, 5]`.
`sym([1, 2, 3, 3], [5, 2, 1, 4])` debería retornar `[3, 4, 5]`.
```js
assert.sameMembers(sym([1, 2, 3, 3], [5, 2, 1, 4]), [3, 4, 5]);
```
`sym([1, 2, 3, 3], [5, 2, 1, 4])` should contain only three elements.
`sym([1, 2, 3, 3], [5, 2, 1, 4])` debería contener solo tres elementos.
```js
assert.equal(sym([1, 2, 3, 3], [5, 2, 1, 4]).length, 3);
```
`sym([1, 2, 3], [5, 2, 1, 4, 5])` should return `[3, 4, 5]`.
`sym([1, 2, 3], [5, 2, 1, 4, 5])` debería retornar `[3, 4, 5]`.
```js
assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4, 5]), [3, 4, 5]);
```
`sym([1, 2, 3], [5, 2, 1, 4, 5])` should contain only three elements.
`sym([1, 2, 3], [5, 2, 1, 4, 5])` debería contener solo tres elementos.
```js
assert.equal(sym([1, 2, 3], [5, 2, 1, 4, 5]).length, 3);
```
`sym([1, 2, 5], [2, 3, 5], [3, 4, 5])` should return `[1, 4, 5]`
`sym([1, 2, 5], [2, 3, 5], [3, 4, 5])` debería retornar `[1, 4, 5]`
```js
assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5]);
```
`sym([1, 2, 5], [2, 3, 5], [3, 4, 5])` should contain only three elements.
`sym([1, 2, 5], [2, 3, 5], [3, 4, 5])` debería contener solo tres elementos.
```js
assert.equal(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]).length, 3);
```
`sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])` should return `[1, 4, 5]`.
`sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])` debería retornar `[1, 4, 5]`.
```js
assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5]);
```
`sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])` should contain only three elements.
`sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])` debería contener solo tres elementos.
```js
assert.equal(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]).length, 3);
```
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3])` should return `[2, 3, 4, 6, 7]`.
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3])` debería retornar `[2, 3, 4, 6, 7]`.
```js
assert.sameMembers(
@ -87,7 +87,7 @@ assert.sameMembers(
);
```
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3])` should contain only five elements.
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3])` debería contener solo cinco elementos.
```js
assert.equal(
@ -96,7 +96,7 @@ assert.equal(
);
```
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])` should return `[1, 2, 4, 5, 6, 7, 8, 9]`.
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])` debería retornar `[1, 2, 4, 5, 6, 7, 8, 9]`.
```js
assert.sameMembers(
@ -112,7 +112,7 @@ assert.sameMembers(
);
```
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])` should contain only eight elements.
`sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])` debería contener solo ocho elementos.
```js
assert.equal(

View File

@ -1,6 +1,6 @@
---
id: 8d5123c8c441eddfaeb5bdef
title: Implement Bubble Sort
title: Implementar ordenación de burbuja
challengeType: 1
forumTopicId: 301612
dashedName: implement-bubble-sort
@ -8,23 +8,23 @@ dashedName: implement-bubble-sort
# --description--
This is the first of several challenges on sorting algorithms. Given an array of unsorted items, we want to be able to return a sorted array. We will see several different methods to do this and learn some tradeoffs between these different approaches. While most modern languages have built-in sorting methods for operations like this, it is still important to understand some of the common basic approaches and learn how they can be implemented.
Este es el primero de varios retos en algoritmos de ordenación. Dado un arreglo de elementos desordenados, queremos ser capaces de devolver un arreglo ordenado. Veremos diferentes métodos para hacerlo y aprenderemos algunos pros y contras entre estos diferentes enfoques. Mientras que la mayoría de los lenguajes modernos tienen métodos de ordenamiento incorporados para este tipo de operaciones, sigue siendo importante entender algunos de los enfoques básicos y aprender cómo pueden implementarse.
Here we will see bubble sort. The bubble sort method starts at the beginning of an unsorted array and 'bubbles up' unsorted values towards the end, iterating through the array until it is completely sorted. It does this by comparing adjacent items and swapping them if they are out of order. The method continues looping through the array until no swaps occur at which point the array is sorted.
Aquí veremos el algoritmo de burbuja. El método de ordenación de burbuja comienza al inicio de un arreglo desordenado y 'burbujea hacia arriba' los valores no ordenados, iterando a través del arreglo hasta que esté completamente ordenado. Esto se hace comparando elementos adyacentes e intercambiándolos si no están en orden. El método continúa iterando sobre el arreglo hasta que no hay mas intercambios, lo que significa que el arreglo esta ordenado.
This method requires multiple iterations through the array and for average and worst cases has quadratic time complexity. While simple, it is usually impractical in most situations.
Este método requiere múltiples iteraciones a través del arreglo y para el promedio y el peor de los casos tiene complejidad de tiempo cuadrática. Si bien es simple, suele ser poco práctico en la mayoría de las situaciones.
**Instructions:** Write a function `bubbleSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest.
**Instrucciones:** Escribe una funcn `bubbleSort` que tomará un arreglo de números enteros y retornará un arreglo con estos números, ordenados de menor a mayor.
# --hints--
`bubbleSort` should be a function.
`bubbleSort` Debería ser una funcn.
```js
assert(typeof bubbleSort == 'function');
```
`bubbleSort` should return a sorted array (least to greatest).
`bubbleSort` Debería retornar un arreglo ordenado (de menor a mayor).
```js
assert(
@ -52,7 +52,7 @@ assert(
);
```
`bubbleSort` should return an array that is unchanged except for order.
`bubbleSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` Debería retornar el mismo arreglo cambiando solo el orden de los números.
```js
assert.sameMembers(
@ -79,7 +79,7 @@ assert.sameMembers(
);
```
`bubbleSort` should not use the built-in `.sort()` method.
`bubbleSort` No debería usar el método incorporado `.sort()`.
```js
assert(isBuiltInSortUsed());
@ -113,8 +113,6 @@ function bubbleSort(array) {
return array;
// Only change code above this line
}
bubbleSort([1, 4, 2, 8, 345, 123, 43, 32, 5643, 63, 123, 43, 2, 55, 1, 234, 92]);
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 587d8259367417b2b2512c86
title: Implement Insertion Sort
title: Implementar Orden de Inserción
challengeType: 1
forumTopicId: 301613
dashedName: implement-insertion-sort
@ -8,19 +8,19 @@ dashedName: implement-insertion-sort
# --description--
The next sorting method we'll look at is insertion sort. This method works by building up a sorted array at the beginning of the list. It begins the sorted array with the first element. Then it inspects the next element and swaps it backwards into the sorted array until it is in sorted position. It continues iterating through the list and swapping new items backwards into the sorted portion until it reaches the end. This algorithm has quadratic time complexity in the average and worst cases.
El siguiente método de clasificación que veremos es el orden de las inserciones. Este método funciona construyendo un arreglo ordenado al principio de la lista. Comienza el arreglo ordenado con el primer elemento. Luego inspecciona el siguiente elemento, lo intercambia de atrás hacia adelante dentro de el arreglo clasificado hasta que esté en posición ordenada. Continúa iterando a través de la lista y cambiando nuevos elementos hacia atrás en la porción ordenada hasta llegar al final. Este algoritmo tiene una complejidad temporal cuadrática en el caso medio y en el peor.
**Instructions:** Write a function `insertionSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest.
**Instrucciones:** Escribe una funcn `insertionSort` que toma un "array" de enteros como entrada y devuelve un array de estos enteros ordenados de menor a mayor.
# --hints--
`insertionSort` should be a function.
`insertionSort` debería ser una funcn.
```js
assert(typeof insertionSort == 'function');
```
`insertionSort` should return a sorted array (least to greatest).
`insertionSort` debería devolver un arreglo ordenado (de menor al más grande).
```js
assert(
@ -48,7 +48,7 @@ assert(
);
```
`insertionSort` should return an array that is unchanged except for order.
`insertionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` debe devolver un arreglo sin cambios excepto por el orden.
```js
assert.sameMembers(
@ -75,7 +75,13 @@ assert.sameMembers(
);
```
`insertionSort` should not use the built-in `.sort()` method.
`insertionSort([5, 4, 33, 2, 8])` debe devolver `[2, 4, 5, 8, 33]`.
```js
assert.deepEqual(insertionSort([5, 4, 33, 2, 8]), [2, 4, 5, 8, 33])
```
`insertionSort` no debe utilizar el método "buil-in" `.sort()`.
```js
assert(isBuiltInSortUsed());
@ -109,8 +115,6 @@ function insertionSort(array) {
return array;
// Only change code above this line
}
insertionSort([1, 4, 2, 8, 345, 123, 43, 32, 5643, 63, 123, 43, 2, 55, 1, 234, 92]);
```
# --solutions--