거리두기 확인하기

    [프로그래머스] 거리두기 확인하기 [python]

    [프로그래머스] 거리두기 확인하기 [python]

    문제 BFS로 문제를 풀었다,,실수가 많아서 오래 걸렸다,, 금방 풀줄 알았는데,, 코드 def solution(places): answer = [] for place in places: q = [] for i,p in enumerate(place): for j in range(len(place)): if p[j] == "P": q.append([i,j]) if len(q) == 0: answer.append(1) continue if bfs(place, q): answer.append(1) continue answer.append(0) return answer def bfs(graph, q): mX = [0,0,1,-1] mY = [1,-1,0,0] for c in q: queue = [[c[0], c..