본문 바로가기

프로그래머스/Lv.319

퍼즐 조각 채우기 - JAVA, BFS, 구현 https://school.programmers.co.kr/learn/courses/30/lessons/84021 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 & 풀이 import java.util.*;class Solution { static class Point { int x, y; Point (int x, int y) { this.x = x; this.y = y; } } static int n; static boolean[][] visited; public int solution(int[][] .. 2025. 6. 3.
아이템 줍기 - JAVA, BFS https://school.programmers.co.kr/learn/courses/30/lessons/87694 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 & 풀이 import java.util.*;class Solution { static final int SIZE = 102; static int[][] board = new int[SIZE][SIZE]; static boolean[][] visited = new boolean[SIZE][SIZE]; static int[] dx = {0, 0, 1, -1}; static int[] dy = {1, -1, 0, 0}; .. 2025. 6. 2.
단어 변환 - JAVA, BFS, Queue https://school.programmers.co.kr/learn/courses/30/lessons/43163 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 & 풀이 import java.util.*;class Solution { static class Word { String word; int count; Word (String word, int count) { this.word = word; this.count = count; } } public int solution(Strin.. 2025. 6. 1.
다단계 칫솔 판매 - JAVA, Map, 2021 Dev-Matching: 웹 백엔드 개발자(상반기) https://school.programmers.co.kr/learn/courses/30/lessons/77486 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 & 풀이 import java.util.*;class Solution { public int[] solution(String[] enroll, String[] referral, String[] seller, int[] amount) { int n = enroll.length; Map nameToIndex = new HashMap(); for (int i = 0; i 0) { .. 2025. 5. 25.
순위 - JAVA, 플로이드 워셜, BFS https://school.programmers.co.kr/learn/courses/30/lessons/49191 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 & 풀이플로이드 워셜 방식class Solution { public int solution(int n, int[][] results) { boolean[][] graph = new boolean[n + 1][n + 1]; for (int[] result : results) { graph[result[0]][result[1]] = true; } .. 2025. 5. 22.
가장 먼 노드 - Java, Graph, BFS https://school.programmers.co.kr/learn/courses/30/lessons/49189 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 & 풀이 import java.util.*;class Solution { static class Node { int node; int count; Node(int pre, int count) { this.node = pre; this.count = count; } } public int solution(int n, int[][] edge) {.. 2025. 5. 21.