๐ป Coding Problems Solving/DFS | BFS | Backtracking
[ํ๋ก๊ทธ๋๋จธ์ค] LV.2 ํผ๋ก๋ (์๋ฐ java)
+ ์์ ํ์ ๋ฌธ์ 1. ๋ฌธ์ :https://school.programmers.co.kr/learn/courses/30/lessons/87946 2. ํ์ด ๋ฐฐ์ด 123,231 ๋ฑ์ผ๋ก ๋๋ ๋ฒ ์์๋ฌ์ผ๊ฒ ๋ค! 3. ์ฝ๋ class Solution { static boolean[] visited; static int count = 0; public int solution(int k, int[][] dungeons) { visited = new boolean[dungeons.length]; dfs(0, k, dungeons); return count; } private void dfs(int depth, int fatigue, int[][] dungeons){ for (int i = 0; i < dungeons..
2023. 3. 1. 22:34
์ต๊ทผ๋๊ธ