Backtracking Subsets Estimated reading: 1 minute 22 views public List> subsets(int[] nums) { List> result = new ArrayList<>(); backtrack(result, new ArrayList<>(), nums, 0); return result; } private void backtrack(List> result, List tempList, int[] nums, int start) { result.add(new ArrayList<>(tempList)); for (int i = start; i < nums.length; i++) { tempList.add(nums[i]); backtrack(result, tempList, nums, i + 1); tempList.remove(tempList.size() - 1); } }