Created
February 28, 2021 01:30
-
-
Save inspirit941/83f4ddd8a0198dac802fcc8da4368d78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(skill, skill_trees): | |
skill_set = set(skill) | |
skill_list = list(skill) | |
count = 0 | |
for string in skill_trees: | |
idx = 0 | |
for i in range(len(string)): | |
if string[i] in skill_set: | |
# 순서상 가능한 스킬트리인지 확인 | |
if string[i] == skill_list[idx]: | |
idx += 1 | |
else: | |
# 불가능한 스킬트리일 경우 | |
count += 1 | |
break | |
return len(skill_trees) - count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment