def solution(board, moves):
answer = 0
basket = [];
top = -1;
for j in moves:
for i in range(len(board)):
if (board[i][j-1] != 0):
current = board[i][j-1]
board[i][j-1] = 0
top += 1
basket.append(current)
if (top > 0 and basket[top] == basket[top-1]):
del basket[top]
del basket[top-1]
top -= 2
answer += 2
break
return answer
'공부 스걱스걱 > 코딩테스트' 카테고리의 다른 글
[python3]프로그래머스_모의고사 (0) | 2021.05.18 |
---|---|
[python3]프로그래머스_신규 아이디 추천 (0) | 2021.05.17 |
[python3]프로그래머스_키패드 누르기 (0) | 2021.05.11 |
[python3]프로그래머스_체육복 (0) | 2021.05.10 |
[python3]프로그래머스_k번째 수 (0) | 2021.05.10 |