We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b41d527 commit 0037a22Copy full SHA for 0037a22
adventJs-2023/challenges/challenge2/challenge2.ts
@@ -0,0 +1,6 @@
1
+export function manufacture (gifts: string[], materials: string): string[] {
2
+ const setMaterials = new Set(materials)
3
+ return gifts.filter(gift => {
4
+ return [...gift].every(letter => setMaterials.has(letter))
5
+ })
6
+}
0 commit comments