게임 맵 최단거리

    [프로그래머스] 게임 맵 최단거리

    [프로그래머스] 게임 맵 최단거리

    문제 간단한 BFS 문제인데, 오랜만에 BFS를 풀어서 버벅거렸다. 그래도 나름 금방 풀었다. 코드 def solution(maps): global mX,mY mX = [0,1,0,-1] mY = [1,0,-1,0] return bfs(maps) def bfs(maps): endX = len(maps) - 1 endY = len(maps[0]) - 1 isVisit = [[ False for j in range(len(maps[0]))] for i in range(len(maps))] queue = [Point(0,0,1)] isVisit[0][0] = True while len(queue) != 0: p = queue.pop(0) if p.x == endX and p.y == endY: return p..