[Java] 순열/조합/부분집합
·
Algorithm
💡순열(Permutation) : 서로 다른 n개의 원소에서 r개를 중복없이 순서에 상관있게 선택하는 혹은 나열하는 것을 순열(permutation)이라고 한다. (나무위키) //nPr public static void main(String[] args) { Scanner sc = new Scanner(System.in); N = sc.nextInt(); R = sc.nextInt(); input = new int[N]; numbers = new int[R]; isSelected = new boolean[N]; // 방문 여부를 체크하기 위함 for (int i = 0; i < N; i++) { input[i] = sc.nextInt(); } permutation(0); } private static v..