Skip to content

Instantly share code, notes, and snippets.

@inspirit941
Created February 28, 2021 01:30
Show Gist options
  • Save inspirit941/83f4ddd8a0198dac802fcc8da4368d78 to your computer and use it in GitHub Desktop.
Save inspirit941/83f4ddd8a0198dac802fcc8da4368d78 to your computer and use it in GitHub Desktop.
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