package org.example.알고리즘.전략망을둘로나누기; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; class Solution { public static void main(String[] args) { Solution solution = new Solution(); System.out.println(solution.solution(9, new int[][]{{1, 3}, {2, 3}, {3, 4}, {4, 5}, {4, 6}, {4, 7}, {7, 8}, {7, 9}})); System.out.println("================================"); System.out.prin..
package org.example.알고리즘.귤고르기; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; class Solution { public static void main(String[] args) { Solution solution = new Solution(); solution.solution(6, new int[]{1, 3, 2, 5, 4, 5, 2, 3}); System.out.println("================================"); solution.solution(4, new int[]{1, 3, 2, 5, 4, 5, 2, 3}..
package org.example.알고리즘.영어끝말잇기; import java.util.Arrays; import java.util.HashSet; import java.util.Set; class Solution { public static void main(String[] args) { Solution solution = new Solution(); String[] words = {"tank", "kick", "know", "wheel", "land", "dream", "mother", "robot", "tank"}; solution.solution(3, words); System.out.println(Arrays.toString(solution.solution(2, new String[]{"hel..
package org.example.알고리즘.PCCP기출문제2번; import java.util.*; class Solution { private static final int[] DX = {0, 0, -1, 1}; private static final int[] DY = {1, -1, 0, 0}; public static void main(String[] args) { Solution solution = new Solution(); System.out.println(solution.solution(new int[][]{{0, 0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 1, 1, 0, 0}, {1, 1, 0, 0, 0, 1, 1, 0}, {1, 1, 1, 0, 0, 0, 0, 0}, ..
코드class Solution { public static void main(String[] args) { Solution solution = new Solution(); System.out.println(solution.solution("CBD", new String[]{"BACDE", "CBADF", "AECB", "BDA"})); System.out.println("================================"); } public int solution(String skill, String[] skill_trees) { int answer = 0; for (String skillTree : skill_trees) { System.out.println("skillTree = " + sk..
package org.example.알고리즘.친구; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) { // 사람의 수 N int N = Integer.parseInt(br.readLine()); char[][] friends = new char[N][N]; for (int i = 0; i < N; i++) { friends[i] = br.readLine() .toCharArray(); }..