What do you mean by number of ways? A = 1(1), 1(2), 2 B = 1(3), 3. a(b) - means - that there is an element with value a but with unique id b if there is only one element with such value, skip brackets.
Here are the possible results of merging (using operator < for the values) 1(1); 1(2); 1(3); 2; 3 1(1); 1(3); 1(2); 2; 3 1(2); 1(1); 1(3); 2; 3 1(2); 1(3); 1(1); 2; 3 1(3); 1(1); 1(2); 2; 3 1(3); 1(2); 1(1); 2; 3 So, the answer will be something like P(1)! * P(2)! * P(3)! ... * P(n)! where P(k) means - amount of elements with value = Array[k]. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.