본문 바로가기

프로그래머스157

퍼즐 조각 채우기 - 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, DFS, HASHMAP, GREEDY https://school.programmers.co.kr/learn/courses/30/lessons/172927 코드 & 풀이 import java.util.*;class Solution { static int min; static int size; static int round; static Map map; static int[][] fatigue = {{1, 1, 1}, {5, 1, 1}, {25, 5, 1}}; public int solution(int[] picks, String[] minerals) { size = minerals.length; round = size % 5 == 0 ? size / 5 : (size / 5)+1; .. 2025. 5. 27.
다단계 칫솔 판매 - 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.