We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ec53d1 commit fb5325eCopy full SHA for fb5325e
src/2020/day6/part1.ts
@@ -1,6 +1,5 @@
1
export const part1 = (input: string) => {
2
return input
3
.split('\n\n')
4
- .map(a => [...new Set(a.split(/\n|\s/).join(''))].length)
5
- .reduce((a, b) => a + b);
+ .reduce((a, b) => a + new Set(b.replace(/(\n|\r)/g, '')).size, 0);
6
};
0 commit comments