For example, there is a string of numbers 1, 2, and 3. the expected result is to give N, such as N2, assign N numbers to each number. after removing their own non-repeated numbers, "2 and 3" is allocated to 1, "3" is allocated to 2, and "1 and 2" is allocated to 3 ", make sure that each number can only be allocated N times... for example, there is a string of numbers 1, 2, 3.
The expected result is to give N, for example, N = 2, and assign N to each number to remove its own non-repeated numbers.
That is, "2, 3" is assigned to 1, "3" is assigned to 2, "1, 2" is assigned to 3, and each number can only be allocated N times.
Because there are many situations that meet the requirements, I only need one of them.
If it is a number 1, 2, 3, 4, then we want N = 2
Then, if the first allocation is 1 corresponding to "2, 3", 2 corresponding to "3", 3 corresponding to "1, 2", then 4 cannot be allocated to the appropriate number. This is not what I need.
To sum up, what should I do if I need to implement such a requirement. Thank you.
Reply content:
For example, there is a string of numbers 1, 2, 3.
The expected result is to give N, for example, N = 2, and assign N to each number to remove its own non-repeated numbers.
That is, "2, 3" is assigned to 1, "3" is assigned to 2, "1, 2" is assigned to 3, and each number can only be allocated N times.
Because there are many situations that meet the requirements, I only need one of them.
If it is a number 1, 2, 3, 4, then we want N = 2
Then, if the first allocation is 1 corresponding to "2, 3", 2 corresponding to "3", 3 corresponding to "1, 2", then 4 cannot be allocated to the appropriate number. This is not what I need.
To sum up, what should I do if I need to implement such a requirement. Thank you.
Problematic question logic
"The expected result is to give N, for example, N = 2, and assign N to each number to remove its own non-repeated numbers"
1, 2, 3. you only need to allocate one to 1, but there are two in your example,
3. it is impossible to allocate three members and remove them.