💻 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
최근댓글