我有 10 行,每行可以有 1-10 个数字,值为 1-100(实际值并不重要)。例如,前三行如下所示:
1. (2 numbers) 1st 2nd 1st 2nd
2. (1 number) all combinations ---> 1st 1st 1st 1st
3. (2 numbers) 1st 1st 2nd 2nd
用实数:
1. 5, 7 5 7 5 7
2. 2 all combinations ---> 2 2 2 2
3. 12, 24 12 12 24 24
This results in a total of 4 unique combinations.
如何解决?我已经尝试过 for 循环和 if 语句,但它根本无法正常工作。