https://school.programmers.co.kr/learn/courses/30/lessons/159994
def solution(cards1, cards2, goal):
for i in goal:
if len(cards1) != 0 and cards1[0] == i:
cards1.pop(0)
elif len(cards2) != 0 and cards2[0] == i:
cards2.pop(0)
else:
return "No"
return "Yes"
카드 길이를 체크해야 list out of index가 발생하지 않는다.