数组A、B、C、D
里面的个数count不一定都相同。
组合顺序是固定的 A[rand] + B[rand] + C[rand] + D[rand] = 不重复字符串
怎么获取最大的组合数量、不重复字符串??
数量 = count(A) * count(B) * count(C) * count(D)
$a = array('a1', 'a2');$b = array('b1', 'b2');$c = array('c1', 'c2', 'c3');$d = array('d1', 'd2', 'd3');print_r(func($a, $b, $c, $d));function func() { $d = func_get_args(); $r = array_shift($d); while($d) { $t = array(); foreach(array_shift($d) as $x) foreach($r as $y) $t[] = $y . $x; $r = $t; } return $r;}好代码.解决了.谢谢
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号