What is the optimal way to find unique combinations of N sets of integers
This may be wrong
I don't follow the multiple set of the set input part of question    

Have a loop for each N  

Assume N = 3
L is length of array A

for(i = 0; i &lt; L-2; i++) 
    for(j = i + 1; j &lt; L-1; j++) 
        for(k = j + 1; k &lt; L; k++)
            A[i], A[j], A[k]


I write poker software and this matches the number of combinations