전.py
프로그래머스 크레인 인형뽑기 게임(level 1)
https://programmers.co.kr/learn/courses/30/lessons/64061 코딩테스트 연습 - 크레인 인형뽑기 게임 [[0,0,0,0,0],[0,0,1,0,3],[0,2,5,0,1],[4,2,4,4,2],[3,5,1,3,1]] [1,5,3,5,1,2,1,4] 4 programmers.co.kr def solution(board, moves): answer = 0 result = [] for i in moves: for j in range(len(board[0])): if board[j][i-1]!= 0: if len(result)>0 and result[-1]==board[j][i-1]: answer += 2 result.pop() else: result.append(board..
2020. 12. 28. 21:33