We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e198e88 commit cfb9edfCopy full SHA for cfb9edf
level-2/게임-맵-최단거리.js
@@ -1,4 +1,4 @@
1
-// https://programmers.co.kr/learn/courses/30/lessons/1844
+// https://github.com/codeisneverodd/programmers-coding-test
2
//정답 1 - prove-ability
3
function solution(maps) {
4
// BFS 활용
@@ -18,7 +18,7 @@ function solution(maps) {
18
// 다음 길 위치
19
const nextY = dy + y, nextX = dx + x;
20
// 맵 밖으로 나간다면
21
- if(isRoad(nextY, nextX, row, col)) continue;
+ if(isOut(nextY, nextX, row, col)) continue;
22
// 도착한 곳이 벽이라면
23
if(maps[nextY][nextX] === 0) continue;
24
// 이미 지난 곳 벽으로 만들어서 다음에 접근 방지
@@ -37,4 +37,4 @@ function solution(maps) {
37
const DIRECTION = [[1, 0], [0, 1], [-1, 0], [0, -1]];
38
39
// 사용이 가능한 길인지 확인하는 함수
40
-const isRoad = (nextY, nextX, row, col) => nextY < 0 || nextX < 0 || nextY > row || nextX > col;
+const isOut = (nextY, nextX, row, col) => nextY < 0 || nextX < 0 || nextY > row || nextX > col;
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments