Skip to content

Commit 167fb2f

Browse files
committed
84차 3번 문제풀이이
1 parent e196038 commit 167fb2f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

live8/test84/문제3/황장현.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function solution(skill, skill_trees) {
2+
let count = 0;
3+
4+
skill_trees.forEach((tree) => {
5+
let filtered = tree
6+
.split('')
7+
.filter((s) => skill.includes(s))
8+
.join('');
9+
if (skill.startsWith(filtered)) count++;
10+
});
11+
12+
return count;
13+
}
14+
15+
console.log(solution('CBD', ['BACDE', 'CBADF', 'AECB', 'BDA']));

0 commit comments

Comments
 (0)