๐ป Coding Problems Solving/DFS | BFS | Backtracking
[ํ๋ก๊ทธ๋๋จธ์ค] ๋ฆฌ์ฝ์ณ ๋ก๋ด (์๋ฐ java)
1. ๋ฌธ์ : https://school.programmers.co.kr/learn/courses/30/lessons/169199 2. ํ์ด bfs๋ก ์ต์๊ฐ ๊ตฌํ๊ธฐ 3. ์ฝ๋ import java.util.*; class Solution { static int[][] map; static boolean[][] visited; static int[] dx = {0,0,1,-1}; static int[] dy = {1,-1,0,0}; static int N,M; static int cnt = Integer.MAX_VALUE; public int solution(String[] board) { int sx = 0; int sy = 0; N = board.length; M = board[0].length(); ..
2023. 12. 1. 21:40
์ต๊ทผ๋๊ธ