题目描述
比如第一组数是:A B C D E 第二组是:1 2 3 4
两组数不一定是对称的,第一组数量比第二组可能多也可能少也可能相同,输出结果举例如下:A1 B2 C3 D4 (只组合不排序),要求输出所有可能的结果
求大佬指点啊
—————–20180710更新——————————–
上面问题的描述不清楚,这是一个拍卖算法的一部分。 数组1和数组2里面的元素匹配以后就删掉,剩下的元素继续匹配。生产的新数组元素个数为数组1和数组2里面最小的元素个数。我写了一个程序,不过感觉不太好。我编程比较差。输出结果大概是这样的:
[[1, ‘A’], [2, ‘B’], [3, ‘C’], [4, ‘D’]]
[[1, ‘A’], [2, ‘B’], [3, ‘C’], [4, ‘E’]]
[[1, ‘A’], [2, ‘B’], [3, ‘D’], [4, ‘C’]]
[[1, ‘A’], [2, ‘B’], [3, ‘D’], [4, ‘E’]]
[[1, ‘A’], [2, ‘B’], [3, ‘E’], [4, ‘C’]]
[[1, ‘A’], [2, ‘B’], [3, ‘E’], [4, ‘D’]]
[[1, ‘A’], [2, ‘C’], [3, ‘B’], [4, ‘D’]]
[[1, ‘A’], [2, ‘C’], [3, ‘B’], [4, ‘E’]]
[[1, ‘A’], [2, ‘C’], [3, ‘D’], [4, ‘B’]]
[[1, ‘A’], [2, ‘C’], [3, ‘D’], [4, ‘E’]]
[[1, ‘A’], [2, ‘C’], [3, ‘E’], [4, ‘B’]]
[[1, ‘A’], [2, ‘C’], [3, ‘E’], [4, ‘D’]]
[[1, ‘A’], [2, ‘D’], [3, ‘B’], [4, ‘C’]]
[[1, ‘A’], [2, ‘D’], [3, ‘B’], [4, ‘E’]]
[[1, ‘A’], [2, ‘D’], [3, ‘C’], [4, ‘B’]]
[[1, ‘A’], [2, ‘D’], [3, ‘C’], [4, ‘E’]]
[[1, ‘A’], [2, ‘D’], [3, ‘E’], [4, ‘B’]]
[[1, ‘A’], [2, ‘D’], [3, ‘E’], [4, ‘C’]]
[[1, ‘A’], [2, ‘E’], [3, ‘B’], [4, ‘C’]]
[[1, ‘A’], [2, ‘E’], [3, ‘B’], [4, ‘D’]]
[[1, ‘A’], [2, ‘E’], [3, ‘C’], [4, ‘B’]]
[[1, ‘A’], [2, ‘E’], [3, ‘C’], [4, ‘D’]]
[[1, ‘A’], [2, ‘E’], [3, ‘D’], [4, ‘B’]]
[[1, ‘A’], [2, ‘E’], [3, ‘D’], [4, ‘C’]]
[[1, ‘B’], [2, ‘A’], [3, ‘C’], [4, ‘D’]]
[[1, ‘B’], [2, ‘A’], [3, ‘C’], [4, ‘E’]]
[[1, ‘B’], [2, ‘A’], [3, ‘D’], [4, ‘C’]]
[[1, ‘B’], [2, ‘A’], [3, ‘D’], [4, ‘E’]]
[[1, ‘B’], [2, ‘A’], [3, ‘E’], [4, ‘C’]]
[[1, ‘B’], [2, ‘A’], [3, ‘E’], [4, ‘D’]]
[[1, ‘B’], [2, ‘C’], [3, ‘A’], [4, ‘D’]]
[[1, ‘B’], [2, ‘C’], [3, ‘A’], [4, ‘E’]]
[[1, ‘B’], [2, ‘C’], [3, ‘D’], [4, ‘A’]]
[[1, ‘B’], [2, ‘C’], [3, ‘D’], [4, ‘E’]]
[[1, ‘B’], [2, ‘C’], [3, ‘E’], [4, ‘A’]]
[[1, ‘B’], [2, ‘C’], [3, ‘E’], [4, ‘D’]]
[[1, ‘B’], [2, ‘D’], [3, ‘A’], [4, ‘C’]]
[[1, ‘B’], [2, ‘D’], [3, ‘A’], [4, ‘E’]]
[[1, ‘B’], [2, ‘D’], [3, ‘C’], [4, ‘A’]]
[[1, ‘B’], [2, ‘D’], [3, ‘C’], [4, ‘E’]]
[[1, ‘B’], [2, ‘D’], [3, ‘E’], [4, ‘A’]]
[[1, ‘B’], [2, ‘D’], [3, ‘E’], [4, ‘C’]]
[[1, ‘B’], [2, ‘E’], [3, ‘A’], [4, ‘C’]]
[[1, ‘B’], [2, ‘E’], [3, ‘A’], [4, ‘D’]]
[[1, ‘B’], [2, ‘E’], [3, ‘C’], [4, ‘A’]]
[[1, ‘B’], [2, ‘E’], [3, ‘C’], [4, ‘D’]]
[[1, ‘B’], [2, ‘E’], [3, ‘D’], [4, ‘A’]]
[[1, ‘B’], [2, ‘E’], [3, ‘D’], [4, ‘C’]]
[[1, ‘C’], [2, ‘A’], [3, ‘B’], [4, ‘D’]]
[[1, ‘C’], [2, ‘A’], [3, ‘B’], [4, ‘E’]]
[[1, ‘C’], [2, ‘A’], [3, ‘D’], [4, ‘B’]]
[[1, ‘C’], [2, ‘A’], [3, ‘D’], [4, ‘E’]]
[[1, ‘C’], [2, ‘A’], [3, ‘E’], [4, ‘B’]]
[[1, ‘C’], [2, ‘A’], [3, ‘E’], [4, ‘D’]]
[[1, ‘C’], [2, ‘B’], [3, ‘A’], [4, ‘D’]]
….省略
题目来源及自己的思路
无
你期待的结果是什么?实际看到的错误信息又是什么?
期待看到好用的算法