Can someone please tell me how to implement combination for character values stored in an array with formula nPr.
For example if I have a set of {a,b,v,f} and I want to choose 2 at a time the answer should be {a,b} {a,v} {a,f} {b,v} {b,f} {v,f}.
Or any link if this problem has a solution on the web.
Thanks.
Here is a general implementation:
Use it like this:
Here’s an ideone.