KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm having a hard time getting started to layout code for this problem. I have a fixed amount of random numbers, in this case 8 numbers. R[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; That are going to be placed in 3 sets of numbers, with the only constraint that each set contain minimum one value, and each value can only be used once. Edit: all 8 numbers should be used For example: R1[] = { 1, 4 } R2[] = { 2, 8, 5, 6 } R3[] = { 7, 3 } I need to loop through all possible combinations of a set R1, R2, R3. Order is not important, so if the above example happened, I don't need R1[] = { 4, 1 } R2[] = { 2, 8, 5, 6 } R3[] = { 7, 3 } NOR R1[] = { 2, 8, 5, 6 } R2[] = { 7, 3 } R3[] = { 1, 4 } What is a good method?
Tags (comma-separated)
Save Edits
Cancel