Karthik Agarwal

Karthik Agarwal

  • NA
  • 748
  • 266k

How to do permutations and combinations?

Jul 27 2012 5:51 AM
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)