Programing/자료구조, Algorithm
programmers -프렌즈4블록- (python)
def solution(m, n, board): answer = 0 maps = [] # maps 좌표 만들기 for i in range(0, m): tmp = [] for j in range(0, n): tmp.append(board[i][j]) maps.append(tmp) while True: rm = [] # 지워질 블록 수집 for x in range(0, m-1): for y in range(0, n-1): if maps[x][y] == maps[x+1][y] and maps[x][y+1] == maps[x+1][y+1] and maps[x][y] == maps[x+1][y+1] and maps[x][y] != 0: rm.append((x, y)) rm.append((x+1, y)) rm.ap..
2022. 3. 14. 03:50