public static List> getPerms(int[] num) { if (num == null || num.length == 0) { return null; } List> res = new ArrayList>(); List first = new ArrayList(); res.add(first); for (int i = 0; i < num.length; i++) { List> newRes = new ArrayList>(); for (int j = 0; j < res.size(); j++) { List current = res.get(j); for (int k = 0; k <= current.size(); k++) { List item = new ArrayList(current); item.add(k, num[i]); newRes.add(item); } } res = newRes; } return res; } 这个是permutation 1, 在这基础上如何改?