Head vs breakz
[code] - 카카오 크레인 인형뽑기 python 본문
#크레인 인형뽑기
def solution(board, moves):
box = []
cnt = 0
for i in range(len(moves)):
for j in range(len(board)):
if board[j][moves[i]-1] != 0 :
box.append(board[j][moves[i]-1])
board[j][moves[i]-1] = 0
if len(box) > 1 and box[-1] == box [-2]:
cnt += 2
box.pop(-1)
box.pop(-1)
break
else :
continue
return cnt
'Head > Code' 카테고리의 다른 글
[code] - 카카오 괄호변환 python (0) | 2020.05.04 |
---|---|
[code] - 카카오 호텔 방 배정 python (0) | 2020.05.02 |
[code] - 이미지에서 글씨 찾기 구글 API / windows에서 (0) | 2020.04.20 |
[code] - 이미지에서 색상 투명화 하기 (0) | 2020.04.16 |
[code] - OpenCV GrabCut (0) | 2020.04.16 |
Comments