[문제]

[풀이]
def solution(cards1, cards2, goal):
a, b = 0, 0
for i in goal:
if a < len(cards1) and i == cards1[a]:
a += 1
elif b < len(cards2) and i == cards2[b]:
b += 1
else:
return "No"
return "Yes"
[링크]
https://school.programmers.co.kr/learn/courses/30/lessons/159994
프로그래머스
SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
'CodingTest > Programmers' 카테고리의 다른 글
| [프로그래머스 Lv1] 추억 점수(python, 해시) (1) | 2025.08.07 |
|---|---|
| [프로그래머스 Lv1] 비밀지도(python, 구현) (0) | 2025.08.07 |
| [프로그래머스 Lv1] 폰켓몬(python, 해시) (0) | 2025.08.07 |
| [프로그래머스 Lv1] 기사단원의 무기(python, 구현) (0) | 2025.08.07 |
| [프로그래머스 Lv1] 모의고사(python, 완전탐색) (0) | 2025.08.07 |
