[찾아라 프로그래밍 마에스터 - 게임 맵 최단거리]
문제 https://programmers.co.kr/learn/courses/30/lessons/1844 코딩테스트 연습 - 게임 맵 최단거리 [[1,0,1,1,1],[1,0,1,0,1],[1,0,1,1,1],[1,1,1,0,1],[0,0,0,0,1]] 11 [[1,0,1,1,1],[1,0,1,0,1],[1,0,1,1,1],[1,1,1,0,0],[0,0,0,0,1]] -1 programmers.co.kr 분석 및 해결 정말 대표적인 BFS, DFS 그래프 탐색 문제였습니다. 하지만 최단 거리를 구할 때는 BFS가 짱짱맨이므로 BFS를 이용했다 import java.util.*; class Solution { public static int[] dy = {-1, 1, 0, 0}; public static ..
2021. 7. 26.