C# 게임 맵 최단거리 - BFS 길찾기 / 프로그래머스 [Lv.2]
출처: 프로그래머스 코딩 테스트 연습 https://school.programmers.co.kr/learn/courses/30/lessons/1844 나의 풀이 using System; using System.Collections.Generic; class Solution { // 최단거리는 BFS가 유리. public int solution(int[,] maps) { int w = maps.GetLength(0); int h = maps.GetLength(1); var open = new Queue(); var parents = new Dictionary(); var dirs = new (int x, int y)[4]{(-1, 0), (1, 0), (0, -1), (0, 1)}; open.Enqueue..