#算法
代码计算出7890数字排列的成六位数的可能
dfs一下即可
public static void main(String[] args) {
List<String> res = new ArrayList<>();
dfs("7890".toCharArray(), 6, new StringBuilder(), res);
System.out.println(res.size());
System.out.println(res);
}
public static void dfs(char[] chars, int len, StringBuilder builder, List<String> res) {
if (builder.length() == len && res.add(builder.toString())) return;
for (char c : chars) {
// 剪枝,去除以0开头的
if (builder.length() == 0 && c == '0') continue;
builder.append(c);
dfs(chars, len, builder, res);
builder.deleteCharAt(builder.length() - 1);
}
}