Skip to content

Commit

Permalink
Co-authored-by: suojae <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoojin-An committed Aug 4, 2024
1 parent 10c8d63 commit 90477a5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Programmers/구현/시뮬레이션/카드뭉치.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def solution(cards1, cards2, goal):
idx1 = 0
idx2 = 0

for value in goal:
if idx1 < len(cards1) and value == cards1[idx1]:
idx1 += 1
elif idx2 < len(cards2) and value == cards2[idx2]:
idx2 += 1
else:
return False

0 comments on commit 90477a5

Please sign in to comment.