반응형 중복조합1 [코딩테스트] Java - 기본 점검: 순열/조합 1. 순열- N개 중 중복 없이 R개를 뽑는 경우더보기static int N = 3, R = 2;static int[] nums = {1, 2, 3}; // 뽑을 대상static int[] output = new int[R]; // 결과 저장static boolean[] visited = new boolean[N];static void perm(int depth) { if (depth == R) { System.out.println(Arrays.toString(output)); return; } for (int i = 0; i 더보기public class PermutationExample { public static void permutation.. 2025. 4. 9. 이전 1 다음 반응형