1
Answer

How to do permutations and combinations?

Karthik Agarwal

Karthik Agarwal

12y
1.6k
1
I have a scenario like this:

Three items with priority 0. 
Let that be priority_0_1, priority_0_2, priority_0_3

Two Items with priority 1. 
Let that be priority_1_1, priority_1_2

One Item with priority 1. 
Let that be priority_2_1


So i want all the outputs as follows:
priority_0_1, priority_1_1, priority_2_1
priority_0_1, priority_1_2, priority_2_1

priority_0_2, priority_1_1, priority_2_1
priority_0_2, priority_1_2, priority_2_1

priority_0_3, priority_1_1, priority_2_1
priority_0_3, priority_1_2, priority_2_1


Note: The above stated is just an example. 
Number of priorities and the number of items in a priority will vary.




Answers (1)