로딩
요청 처리 중입니다...

JAVA_LeetCode 46_Permutations

 JAVA_LeetCode 46_Permutations

JAVA_LeetCode 46_Permutations 풀이 class Solution { public List permute(int[] nums) { List list = new ArrayList(); check(nums, list, new ArrayList()); return list; } public void check(int[] nums, List list, List temp){ // 모두 돌면 리스트에 담기 if(temp.size() == nums.length){ list.add(new ArrayList(temp)); return; } // 배열별 반복하되, 존재하면 넘기고 미존재시 추가 후 백트래킹 for(int num : nums){ if(temp.contains(num)) continue; temp.add(num); check(nums, list, temp); te...