思路:每个数字在子集中有两种情况,一种是不包含自己,另一种是包含自己。因此,可通过回溯法来记录每个数字分别在这两种情况下的组合。 import java.util.*; public class Solution { int length; ArrayList<ArrayList<Integer>> res = new ArrayList<>(); ArrayList<Integer> record = new Arr...