[Programmers] 크레인 인형뽑기 게임
·
💯 CodingTest/Programmers
▶ 문제 : 더보기 https://programmers.co.kr/learn/courses/30/lessons/64061 ▶ 코드 : from collections import deque def solution(board, moves): count = 0 st = deque() for num in moves: for i in range(len(board)): item = board[i][num-1] if item == 0: continue else: if len(st) != 0: recent_item = st.popleft() if recent_item == item: count += 2 else: st.appendleft(recent_item) st.appendleft(item) else: st.app..