Skip to content

Commit

Permalink
✨ Add challenge-23 solution
Browse files Browse the repository at this point in the history
  • Loading branch information
marcode24 committed Dec 23, 2024
1 parent 3221eb9 commit 920dc59
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 2024/23-encuentra-los-numeros-perdidos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ findDisappearedNumbers([5, 5, 5, 3, 3, 2, 1])

## Mi solución explicada

**NOTA** Para correr este código necesitas la versión 22 o superior de Node.js. En caso contrario, puedes crear una función `difference` que haga lo mismo que `Set.prototype.difference`.

```js
Set.prototype.difference = function (set) {
return new Set([...this].filter((x) => !set.has(x)));
};
```

```js
function findMissingNumbers(nums) {
const maxNumber = Math.max(...nums);
Expand Down

0 comments on commit 920dc59

Please sign in to comment.