Skip to content

Commit ce32187

Browse files
committed
96차 1번 불필요 변수 제거
1 parent a0f9220 commit ce32187

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

live9/test96/문제1/박희경.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from collections import *
22

33
def solution(board):
4-
answer = 0
5-
64
# 상하좌우
75
dx = [0, 0, -1, 1]
86
dy = [1, -1, 0, 0]
@@ -19,7 +17,7 @@ def bfs(x, y, move):
1917
x, y, move = q.popleft()
2018
if board[x][y] == 'G':
2119
return move
22-
# 'D' 만날 때까지 이동 (이 부분 참고)
20+
# 'D' 만날 때까지 이동
2321
for i in range(4):
2422
nx, ny = x, y
2523
while 0 <= nx + dx[i] < n and 0 <= ny + dy[i] < m and board[nx + dx[i]][ny + dy[i]] != 'D':
@@ -34,7 +32,4 @@ def bfs(x, y, move):
3432
for i in range(n):
3533
for j in range(m):
3634
if board[i][j] == 'R':
37-
return bfs(i, j, 0)
38-
39-
40-
return answer
35+
return bfs(i, j, 0)

0 commit comments

Comments
 (0)