mirror of
https://github.com/seigler/advent-of-code-2020
synced 2025-07-27 08:16:08 +00:00
Use Sets
This commit is contained in:
parent
b34569db85
commit
9581bd568b
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ async function run () {
|
|||
}
|
||||
|
||||
function yesses (group) {
|
||||
return group.replace(/\s+/gm, '').split('').reduce((acc, cur) => acc.includes(cur) ? acc : [...acc, cur], [])
|
||||
return [...new Set(group.replace(/\s+/gm, '').split(''))]
|
||||
}
|
||||
|
||||
async function solveForFirstStar (input) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue