Skip to content

Commit 15b826b

Browse files
committed
Memory score / 중급
1 parent 9da00ee commit 15b826b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const solution = (name, yearning, photo) => {
2+
const map = name.reduce((map, name, idx) => {
3+
map[name] = yearning[idx]
4+
return map
5+
}, {})
6+
7+
return photo.map((p) => p.reduce((acc, cur) => (acc += map[cur] || 0), 0))
8+
}

0 commit comments

Comments
 (0)