Skip to content

Commit 0037a22

Browse files
feat: ✨ add the solution for challenge 2
1 parent b41d527 commit 0037a22

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)