반응형
def solution(cards1, cards2, goal):
check_goal = []
for word in goal:
if word in cards1:
check_index = cards1.index(word)
if check_index != 0:
return "No"
else:
check_goal.append(word)
cards1.pop(0)
if word in cards2:
check_index = cards2.index(word)
if check_index != 0:
return "No"
else:
check_goal.append(word)
cards2.pop(0)
return "Yes"
반응형
'삽집하는 개발들 > 알고리즘' 카테고리의 다른 글
[43일차][프로그래머스][42840]모의고사 (0) | 2023.08.11 |
---|---|
[42일차][프로그래머스][135808]과일 장수 (1) | 2023.08.10 |
[41일차][프로그래머스][1845]폰켓몬 (0) | 2023.08.09 |
[40일차][프로그래머스][12901]2016년 (0) | 2023.08.08 |
[39일차][프로그래머스][138477]명예의 전당 (1) (0) | 2023.08.07 |